mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 08:47:12 +03:00
Add a -r option to hg svn. Use with hg svn info to change the mercurial rev.
This commit is contained in:
parent
83d943ae6e
commit
f59461883f
@ -168,6 +168,7 @@ cmdtable = {
|
|||||||
('', 'force', False, 'force an operation to happen'),
|
('', 'force', False, 'force an operation to happen'),
|
||||||
('', 'username', '', 'username for authentication'),
|
('', 'username', '', 'username for authentication'),
|
||||||
('', 'password', '', 'password for authentication'),
|
('', 'password', '', 'password for authentication'),
|
||||||
|
('r', 'rev', '', 'Mercurial revision'),
|
||||||
],
|
],
|
||||||
svncommands._helpgen(),
|
svncommands._helpgen(),
|
||||||
),
|
),
|
||||||
|
@ -36,7 +36,12 @@ def info(ui, repo, hg_repo_path, **opts):
|
|||||||
"""
|
"""
|
||||||
meta = repo.svnmeta()
|
meta = repo.svnmeta()
|
||||||
hashes = meta.revmap.hashes()
|
hashes = meta.revmap.hashes()
|
||||||
parent = util.parentrev(ui, repo, meta, hashes)
|
|
||||||
|
if opts.get('rev'):
|
||||||
|
parent = repo[opts['rev']]
|
||||||
|
else:
|
||||||
|
parent = util.parentrev(ui, repo, meta, hashes)
|
||||||
|
|
||||||
pn = parent.node()
|
pn = parent.node()
|
||||||
if pn not in hashes:
|
if pn not in hashes:
|
||||||
ui.status('Not a child of an svn revision.\n')
|
ui.status('Not a child of an svn revision.\n')
|
||||||
|
@ -54,6 +54,17 @@ class UtilityTests(test_util.TestBase):
|
|||||||
'rev': 6,
|
'rev': 6,
|
||||||
})
|
})
|
||||||
self.assertEqual(actual, expected)
|
self.assertEqual(actual, expected)
|
||||||
|
hg.update(self.repo, 'default')
|
||||||
|
u.pushbuffer()
|
||||||
|
utility_commands.info(u, self.repo, self.wc_path, rev=3)
|
||||||
|
actual = u.popbuffer()
|
||||||
|
expected = (expected_info_output %
|
||||||
|
{'date': '2008-10-08 01:39:05 +0000 (Wed, 08 Oct 2008)',
|
||||||
|
'repourl': self.repourl,
|
||||||
|
'branch': 'branches/the_branch',
|
||||||
|
'rev': 5,
|
||||||
|
})
|
||||||
|
self.assertEqual(actual, expected)
|
||||||
|
|
||||||
def test_parent_output(self):
|
def test_parent_output(self):
|
||||||
self._load_fixture_and_fetch('two_heads.svndump')
|
self._load_fixture_and_fetch('two_heads.svndump')
|
||||||
|
Loading…
Reference in New Issue
Block a user