changeset 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 463998d266e3
children 47127255145c
files tests/test_utility_commands.py utility_commands.py
diffstat 2 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test_utility_commands.py
+++ b/tests/test_utility_commands.py
@@ -13,7 +13,7 @@ import fetch_command
 import test_util
 
 expected_info_output = '''URL: file://%(repo)s/%(branch)s
-Repository Root: None
+Repository Root: file://%(repo)s
 Repository UUID: df2126f7-00ab-4d49-b42c-7e981dde0bcf
 Revision: %(rev)s
 Node Kind: directory
--- 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,