##// END OF EJS Templates
import: disallow meaningless combination of "--exact" and "--edit"...
FUJIWARA Katsunori -
r22277:e116abad default
parent child Browse files
Show More
@@ -3880,6 +3880,8 b' def import_(ui, repo, patch1=None, *patc'
3880 raise util.Abort(_('similarity must be between 0 and 100'))
3880 raise util.Abort(_('similarity must be between 0 and 100'))
3881 if sim and not update:
3881 if sim and not update:
3882 raise util.Abort(_('cannot use --similarity with --bypass'))
3882 raise util.Abort(_('cannot use --similarity with --bypass'))
3883 if opts.get('exact') and opts.get('edit'):
3884 raise util.Abort(_('cannot use --exact with --edit'))
3883
3885
3884 if update:
3886 if update:
3885 cmdutil.checkunfinished(repo)
3887 cmdutil.checkunfinished(repo)
@@ -22,10 +22,13 b' Test --bypass with other options'
22 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
22 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
23
23
24 Test importing an existing revision
24 Test importing an existing revision
25 (this also tests that editor is not invoked for '--bypass', if the
25 (this also tests that "hg import" disallows combination of '--exact'
26 patch contains the commit message, regardless of '--edit')
26 and '--edit')
27
27
28 $ HGEDITOR=cat hg import --bypass --exact --edit ../test.diff
28 $ hg import --bypass --exact --edit ../test.diff
29 abort: cannot use --exact with --edit
30 [255]
31 $ hg import --bypass --exact ../test.diff
29 applying ../test.diff
32 applying ../test.diff
30 $ shortlog
33 $ shortlog
31 o 1:4e322f7ce8e3 test 0 0 - foo - changea
34 o 1:4e322f7ce8e3 test 0 0 - foo - changea
@@ -66,8 +69,10 b' Test --user, --date and --message'
66 repository tip rolled back to revision 1 (undo import)
69 repository tip rolled back to revision 1 (undo import)
67
70
68 Test --import-branch
71 Test --import-branch
72 (this also tests that editor is not invoked for '--bypass', if the
73 patch contains the commit message, regardless of '--edit')
69
74
70 $ hg import --bypass --import-branch ../test.diff
75 $ HGEDITOR=cat hg import --bypass --import-branch --edit ../test.diff
71 applying ../test.diff
76 applying ../test.diff
72 $ shortlog
77 $ shortlog
73 o 1:4e322f7ce8e3 test 0 0 - foo - changea
78 o 1:4e322f7ce8e3 test 0 0 - foo - changea
General Comments 0
You need to be logged in to leave comments. Login now