##// END OF EJS Templates
import: leverage cmdutil.check_incompatible_arguments()...
Martin von Zweigbergk -
r46332:d1cabce5 default
parent child Browse files
Show More
@@ -4041,6 +4041,10 b' def import_(ui, repo, patch1=None, *patc'
4041 Returns 0 on success, 1 on partial success (see --partial).
4041 Returns 0 on success, 1 on partial success (see --partial).
4042 """
4042 """
4043
4043
4044 cmdutil.check_incompatible_arguments(
4045 opts, 'no_commit', ['bypass', 'secret']
4046 )
4047 cmdutil.check_incompatible_arguments(opts, 'exact', ['edit', 'prefix'])
4044 opts = pycompat.byteskwargs(opts)
4048 opts = pycompat.byteskwargs(opts)
4045 if not patch1:
4049 if not patch1:
4046 raise error.Abort(_(b'need at least one patch to import'))
4050 raise error.Abort(_(b'need at least one patch to import'))
@@ -4053,10 +4057,6 b' def import_(ui, repo, patch1=None, *patc'
4053
4057
4054 exact = opts.get(b'exact')
4058 exact = opts.get(b'exact')
4055 update = not opts.get(b'bypass')
4059 update = not opts.get(b'bypass')
4056 if not update and opts.get(b'no_commit'):
4057 raise error.Abort(_(b'cannot use --no-commit with --bypass'))
4058 if opts.get(b'secret') and opts.get(b'no_commit'):
4059 raise error.Abort(_(b'cannot use --no-commit with --secret'))
4060 try:
4060 try:
4061 sim = float(opts.get(b'similarity') or 0)
4061 sim = float(opts.get(b'similarity') or 0)
4062 except ValueError:
4062 except ValueError:
@@ -4065,11 +4065,6 b' def import_(ui, repo, patch1=None, *patc'
4065 raise error.Abort(_(b'similarity must be between 0 and 100'))
4065 raise error.Abort(_(b'similarity must be between 0 and 100'))
4066 if sim and not update:
4066 if sim and not update:
4067 raise error.Abort(_(b'cannot use --similarity with --bypass'))
4067 raise error.Abort(_(b'cannot use --similarity with --bypass'))
4068 if exact:
4069 if opts.get(b'edit'):
4070 raise error.Abort(_(b'cannot use --exact with --edit'))
4071 if opts.get(b'prefix'):
4072 raise error.Abort(_(b'cannot use --exact with --prefix'))
4073
4068
4074 base = opts[b"base"]
4069 base = opts[b"base"]
4075 msgs = []
4070 msgs = []
@@ -26,7 +26,7 b' Test importing an existing revision'
26 and '--edit')
26 and '--edit')
27
27
28 $ hg import --bypass --exact --edit ../test.diff
28 $ hg import --bypass --exact --edit ../test.diff
29 abort: cannot use --exact with --edit
29 abort: cannot specify both --exact and --edit
30 [255]
30 [255]
31 $ hg import --bypass --exact ../test.diff
31 $ hg import --bypass --exact ../test.diff
32 applying ../test.diff
32 applying ../test.diff
@@ -188,13 +188,13 b' Test --strip with --bypass'
188 Test unsupported combinations
188 Test unsupported combinations
189
189
190 $ hg import --bypass --no-commit ../test.diff
190 $ hg import --bypass --no-commit ../test.diff
191 abort: cannot use --no-commit with --bypass
191 abort: cannot specify both --no-commit and --bypass
192 [255]
192 [255]
193 $ hg import --bypass --similarity 50 ../test.diff
193 $ hg import --bypass --similarity 50 ../test.diff
194 abort: cannot use --similarity with --bypass
194 abort: cannot use --similarity with --bypass
195 [255]
195 [255]
196 $ hg import --exact --prefix dir/ ../test.diff
196 $ hg import --exact --prefix dir/ ../test.diff
197 abort: cannot use --exact with --prefix
197 abort: cannot specify both --exact and --prefix
198 [255]
198 [255]
199
199
200 Test commit editor
200 Test commit editor
@@ -444,7 +444,7 b' hg import --secret'
444
444
445 $ hg clone -r0 a b -q
445 $ hg clone -r0 a b -q
446 $ hg --cwd b import --no-commit --secret ../exported-tip.patch
446 $ hg --cwd b import --no-commit --secret ../exported-tip.patch
447 abort: cannot use --no-commit with --secret
447 abort: cannot specify both --no-commit and --secret
448 [255]
448 [255]
449 $ hg --cwd b import --secret ../exported-tip.patch
449 $ hg --cwd b import --secret ../exported-tip.patch
450 applying ../exported-tip.patch
450 applying ../exported-tip.patch
General Comments 0
You need to be logged in to leave comments. Login now