mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 07:17:55 +03:00
githelp: revspec ending in "~" in git becomes "~1" in mercurial
Summary: Before this patch: hg githelp -- reset HEAD~ returned hg reset .~ which was wrong. With this patch it retuns hg reset .~1. Test Plan: added a test Reviewers: mitrandir, durham Subscribers: scottf Differential Revision: https://phabricator.fb.com/D2166551
This commit is contained in:
parent
a2baee7984
commit
9ae26181cd
@ -37,6 +37,8 @@ def convert(s):
|
||||
return s[7:]
|
||||
if 'HEAD' in s:
|
||||
s = s.replace('HEAD', '.')
|
||||
# HEAD~ in git is .~1 in mercurial
|
||||
s = re.sub('~$', '~1', s)
|
||||
return s
|
||||
|
||||
@command('^githelp|git', [
|
||||
|
@ -126,3 +126,11 @@ githelp for checkout with an argument that's both a file and a revision
|
||||
githelp for grep with pattern and path
|
||||
$ hg githelp -- grep shrubbery flib/intern/
|
||||
hg grep shrubbery flib/intern/
|
||||
|
||||
githelp for reset, checking ~ in git becomes ~1 in mercurial
|
||||
$ hg githelp -- reset HEAD~
|
||||
hg reset .~1
|
||||
$ hg githelp -- reset HEAD^
|
||||
hg reset .^
|
||||
$ hg githelp -- reset HEAD~3
|
||||
hg reset .~3
|
||||
|
Loading…
Reference in New Issue
Block a user