# HG changeset patch # User Augie Fackler # Date 1265475478 21600 # Node ID b97f5734e5a850db71fbc17bd26292c6b2a36b85 # Parent 2148eb4b4da4c18f0cb1616b4c465df860f9a5d0 utility_commands: unbreak hg svn info with single-directory clones diff --git a/hgsubversion/utility_commands.py b/hgsubversion/utility_commands.py --- a/hgsubversion/utility_commands.py +++ b/hgsubversion/utility_commands.py @@ -48,7 +48,9 @@ def info(ui, repo, hg_repo_path, **opts) return 0 r, br = hashes[pn] subdir = parent.extra()['convert_revision'][40:].split('@')[0] - if br == None: + if meta.layout == 'single': + branchpath = '' + elif br == None: branchpath = '/trunk' elif br.startswith('../'): branchpath = '/%s' % br[3:] diff --git a/tests/test_utility_commands.py b/tests/test_utility_commands.py --- a/tests/test_utility_commands.py +++ b/tests/test_utility_commands.py @@ -66,6 +66,21 @@ class UtilityTests(test_util.TestBase): }) self.assertEqual(actual, expected) + def test_info_single(self): + self._load_fixture_and_fetch('two_heads.svndump', subdir='trunk') + hg.update(self.repo, 'tip') + u = ui.ui() + u.pushbuffer() + utility_commands.info(u, self.repo, self.wc_path) + actual = u.popbuffer() + expected = (expected_info_output % + {'date': '2008-10-08 01:39:29 +0000 (Wed, 08 Oct 2008)', + 'repourl': self.repourl, + 'branch': 'trunk', + 'rev': 6, + }) + self.assertStringEqual(expected, actual) + def test_parent_output(self): self._load_fixture_and_fetch('two_heads.svndump') u = ui.ui()