diff utility_commands.py @ 212:a421aca2b0f5

info: produce canonical URLs more of the time.
author Augie Fackler <durin42@gmail.com>
date Tue, 17 Mar 2009 15:11:03 -0500
parents 91db8fc049b0
children 794f473b9b49 bb2b78f9f4ce
line wrap: on
line diff
--- a/utility_commands.py
+++ b/utility_commands.py
@@ -73,8 +73,12 @@ def run_svn_info(ui, repo, hg_repo_path,
                                  hge.revmap.iterkeys()))
     parent = find_wc_parent_rev(ui, repo, hge, svn_commit_hashes)
     r, br = svn_commit_hashes[parent.node()]
+    subdir = parent.extra()['convert_revision'][40:].split('@')[0]
     if br == None:
         branchpath = '/trunk'
+    elif br.startswith('../'):
+        branchpath = '/%s' % br[3:]
+        subdir = subdir.replace('branches/../', '')
     else:
         branchpath = '/branches/%s' % br
     url = hge.url
@@ -83,7 +87,6 @@ def run_svn_info(ui, repo, hg_repo_path,
     url = '%s%s' % (url, branchpath)
     author = '@'.join(parent.user().split('@')[:-1])
     # cleverly figure out repo root w/o actually contacting the server
-    subdir = parent.extra()['convert_revision'][40:].split('@')[0]
     reporoot = url[:len(url)-len(subdir)]
     ui.status('''URL: %(url)s
 Repository Root: %(reporoot)s