##// END OF EJS Templates
errors: raise more specifc errors from narrowcommands...
Martin von Zweigbergk -
r46733:6cc269bd default
parent child Browse files
Show More
@@ -103,7 +103,7 def clonenarrowcmd(orig, ui, repo, *args
103 103
104 104 includes, excludes, profiles = sparse.parseconfig(ui, fdata, b'narrow')
105 105 if profiles:
106 raise error.Abort(
106 raise error.ConfigError(
107 107 _(
108 108 b"cannot specify other files using '%include' in"
109 109 b" narrowspec"
@@ -252,7 +252,7 def _narrow(
252 252 % (len(visibletostrip) - maxnodes)
253 253 )
254 254 if not force:
255 raise error.Abort(
255 raise error.StateError(
256 256 _(b'local changes found'),
257 257 hint=_(b'use --force-delete-local-changes to ignore'),
258 258 )
@@ -487,7 +487,7 def trackedcmd(ui, repo, remotepath=None
487 487 """
488 488 opts = pycompat.byteskwargs(opts)
489 489 if requirements.NARROW_REQUIREMENT not in repo.requirements:
490 raise error.Abort(
490 raise error.InputError(
491 491 _(
492 492 b'the tracked command is only supported on '
493 493 b'repositories cloned with --narrow'
@@ -497,7 +497,7 def trackedcmd(ui, repo, remotepath=None
497 497 # Before supporting, decide whether it "hg tracked --clear" should mean
498 498 # tracking no paths or all paths.
499 499 if opts[b'clear']:
500 raise error.Abort(_(b'the --clear option is not yet supported'))
500 raise error.InputError(_(b'the --clear option is not yet supported'))
501 501
502 502 # import rules from a file
503 503 newrules = opts.get(b'import_rules')
@@ -506,7 +506,7 def trackedcmd(ui, repo, remotepath=None
506 506 filepath = os.path.join(encoding.getcwd(), newrules)
507 507 fdata = util.readfile(filepath)
508 508 except IOError as inst:
509 raise error.Abort(
509 raise error.StorageError(
510 510 _(b"cannot read narrowspecs from '%s': %s")
511 511 % (filepath, encoding.strtolocal(inst.strerror))
512 512 )
@@ -514,7 +514,7 def trackedcmd(ui, repo, remotepath=None
514 514 ui, fdata, b'narrow'
515 515 )
516 516 if profiles:
517 raise error.Abort(
517 raise error.InputError(
518 518 _(
519 519 b"including other spec files using '%include' "
520 520 b"is not supported in narrowspec"
@@ -136,8 +136,8 Testing the --narrowspec flag to clone
136 136
137 137 $ hg clone ssh://user@dummy/master specfile --narrowspec narrowspecs
138 138 reading narrowspec from '$TESTTMP/narrowspecs'
139 abort: cannot specify other files using '%include' in narrowspec
140 [255]
139 config error: cannot specify other files using '%include' in narrowspec
140 [30]
141 141
142 142 $ cat > narrowspecs <<EOF
143 143 > [include]
@@ -254,8 +254,8 Testing the --narrowspec flag to clone
254 254
255 255 $ hg clone ssh://user@dummy/master specfile --narrowspec narrowspecs
256 256 reading narrowspec from '$TESTTMP/narrowspecs'
257 abort: cannot specify other files using '%include' in narrowspec
258 [255]
257 config error: cannot specify other files using '%include' in narrowspec
258 [30]
259 259
260 260 $ cat > narrowspecs <<EOF
261 261 > [include]
@@ -121,7 +121,7 Testing the --import-rules flag of `hg t
121 121 [255]
122 122 $ hg tracked --import-rules doesnotexist
123 123 abort: cannot read narrowspecs from '$TESTTMP/narrow/doesnotexist': $ENOENT$
124 [255]
124 [50]
125 125
126 126 $ cat > specs <<EOF
127 127 > %include foo
@@ -133,7 +133,7 Testing the --import-rules flag of `hg t
133 133
134 134 $ hg tracked --import-rules specs
135 135 abort: including other spec files using '%include' is not supported in narrowspec
136 [255]
136 [10]
137 137
138 138 $ cat > specs <<EOF
139 139 > [include]
@@ -198,7 +198,7 Testing the --import-rules flag with --a
198 198
199 199 $ hg tracked --import-rules specs --clear
200 200 abort: the --clear option is not yet supported
201 [255]
201 [10]
202 202
203 203 Testing with passing a out of wdir file
204 204
@@ -224,4 +224,4 Testing tracked command on a non-narrow
224 224 $ cd non-narrow
225 225 $ hg tracked --addinclude foobar
226 226 abort: the tracked command is only supported on repositories cloned with --narrow
227 [255]
227 [10]
@@ -98,7 +98,7 Test repo with local changes
98 98 * (glob)
99 99 abort: local changes found
100 100 (use --force-delete-local-changes to ignore)
101 [255]
101 [20]
102 102 Check that nothing was removed by the failed attempts
103 103 $ hg tracked
104 104 I path:d0
@@ -422,7 +422,7 produces more sensible diffs)
422 422 ...and 5 more, use --verbose to list all
423 423 abort: local changes found
424 424 (use --force-delete-local-changes to ignore)
425 [255]
425 [20]
426 426 Now test it *with* verbose.
427 427 $ hg tracked --removeinclude d9 --verbose
428 428 comparing with ssh://user@dummy/master
@@ -446,7 +446,7 Now test it *with* verbose.
446 446 ^[0-9a-f]{12}$ (re)
447 447 abort: local changes found
448 448 (use --force-delete-local-changes to ignore)
449 [255]
449 [20]
450 450 $ cd ..
451 451
452 452 Test --auto-remove-includes
General Comments 0
You need to be logged in to leave comments. Login now