diff utility_commands.py @ 160:7a5a0b5c8e34

info: Actually determine and show the repo root.
author Augie Fackler <durin42@gmail.com>
date Tue, 30 Dec 2008 10:12:16 -0600
parents 91541523ea5c
children 7a58ff3502b7
line wrap: on
line diff
--- a/utility_commands.py
+++ b/utility_commands.py
@@ -37,6 +37,9 @@ def run_svn_info(ui, repo, hg_repo_path,
         url = url[:-1]
     url = '%s%s' % (url, branchpath)
     author = '@'.join(workingctx.user().split('@')[:-1])
+    # cleverly figure out repo root w/o actually contacting the server
+    subdir = workingctx.extra()['convert_revision'][40:].split('@')[0]
+    reporoot = url[:len(url)-len(subdir)]
     ui.status('''URL: %(url)s
 Repository Root: %(reporoot)s
 Repository UUID: %(uuid)s
@@ -45,7 +48,7 @@ Node Kind: directory
 Last Changed Author: %(author)s
 Last Changed Rev: %(revision)s
 Last Changed Date: %(date)s\n''' %
-              {'reporoot': None,
+              {'reporoot': reporoot,
                'uuid': open(hge.uuid_file).read(),
                'url': url,
                'author': author,