##// END OF EJS Templates
logcmdutil: raise `StateError` when file to follow doesn't exist...
Martin von Zweigbergk -
r49402:3b6b43a7 default
parent child Browse files
Show More
@@ -831,7 +831,7 b' def _makematcher(repo, revs, wopts):'
831 # take the slow path.
831 # take the slow path.
832 found = slowpath = True
832 found = slowpath = True
833 if not found:
833 if not found:
834 raise error.Abort(
834 raise error.StateError(
835 _(
835 _(
836 b'cannot follow file not in any of the specified '
836 b'cannot follow file not in any of the specified '
837 b'revisions: "%s"'
837 b'revisions: "%s"'
@@ -847,7 +847,7 b' def _makematcher(repo, revs, wopts):'
847 slowpath = True
847 slowpath = True
848 continue
848 continue
849 else:
849 else:
850 raise error.Abort(
850 raise error.StateError(
851 _(
851 _(
852 b'cannot follow file not in parent '
852 b'cannot follow file not in parent '
853 b'revision: "%s"'
853 b'revision: "%s"'
@@ -858,7 +858,7 b' def _makematcher(repo, revs, wopts):'
858 if not filelog:
858 if not filelog:
859 # A file exists in wdir but not in history, which means
859 # A file exists in wdir but not in history, which means
860 # the file isn't committed yet.
860 # the file isn't committed yet.
861 raise error.Abort(
861 raise error.StateError(
862 _(b'cannot follow nonexistent file: "%s"') % f
862 _(b'cannot follow nonexistent file: "%s"') % f
863 )
863 )
864 else:
864 else:
@@ -1138,7 +1138,7 b' def getlinerangerevs(repo, userrevs, opt'
1138 linerangesbyrev = {}
1138 linerangesbyrev = {}
1139 for fname, (fromline, toline) in _parselinerangeopt(repo, opts):
1139 for fname, (fromline, toline) in _parselinerangeopt(repo, opts):
1140 if fname not in wctx:
1140 if fname not in wctx:
1141 raise error.Abort(
1141 raise error.StateError(
1142 _(b'cannot follow file not in parent revision: "%s"') % fname
1142 _(b'cannot follow file not in parent revision: "%s"') % fname
1143 )
1143 )
1144 fctx = wctx.filectx(fname)
1144 fctx = wctx.filectx(fname)
@@ -1200,11 +1200,11 b' follow file history from wdir parent, co'
1200
1200
1201 $ hg log -f add0-cp4
1201 $ hg log -f add0-cp4
1202 abort: cannot follow nonexistent file: "add0-cp4"
1202 abort: cannot follow nonexistent file: "add0-cp4"
1203 [255]
1203 [20]
1204
1204
1205 $ hg grep --diff -f data add0-cp4
1205 $ hg grep --diff -f data add0-cp4
1206 abort: cannot follow nonexistent file: "add0-cp4"
1206 abort: cannot follow nonexistent file: "add0-cp4"
1207 [255]
1207 [20]
1208
1208
1209 BROKEN: maybe better to abort
1209 BROKEN: maybe better to abort
1210 $ hg grep -f data add0-cp4
1210 $ hg grep -f data add0-cp4
@@ -1214,11 +1214,11 b' follow file history from wdir parent, re'
1214
1214
1215 $ hg log -f add0-cp1-mod1-rm3
1215 $ hg log -f add0-cp1-mod1-rm3
1216 abort: cannot follow file not in parent revision: "add0-cp1-mod1-rm3"
1216 abort: cannot follow file not in parent revision: "add0-cp1-mod1-rm3"
1217 [255]
1217 [20]
1218
1218
1219 $ hg grep --diff -f data add0-cp1-mod1-rm3
1219 $ hg grep --diff -f data add0-cp1-mod1-rm3
1220 abort: cannot follow file not in parent revision: "add0-cp1-mod1-rm3"
1220 abort: cannot follow file not in parent revision: "add0-cp1-mod1-rm3"
1221 [255]
1221 [20]
1222
1222
1223 BROKEN: maybe better to abort
1223 BROKEN: maybe better to abort
1224 $ hg grep -f data add0-cp1-mod1-rm3
1224 $ hg grep -f data add0-cp1-mod1-rm3
@@ -1229,11 +1229,11 b' follow file history from wdir parent (ex'
1229
1229
1230 $ hg log -fr. add0-cp1-mod1-rm3
1230 $ hg log -fr. add0-cp1-mod1-rm3
1231 abort: cannot follow file not in any of the specified revisions: "add0-cp1-mod1-rm3"
1231 abort: cannot follow file not in any of the specified revisions: "add0-cp1-mod1-rm3"
1232 [255]
1232 [20]
1233
1233
1234 $ hg grep --diff -fr. data add0-cp1-mod1-rm3
1234 $ hg grep --diff -fr. data add0-cp1-mod1-rm3
1235 abort: cannot follow file not in any of the specified revisions: "add0-cp1-mod1-rm3"
1235 abort: cannot follow file not in any of the specified revisions: "add0-cp1-mod1-rm3"
1236 [255]
1236 [20]
1237
1237
1238 BROKEN: should abort
1238 BROKEN: should abort
1239 $ hg grep -fr. data add0-cp1-mod1-rm3
1239 $ hg grep -fr. data add0-cp1-mod1-rm3
@@ -1244,11 +1244,11 b' follow file history from wdir parent, re'
1244
1244
1245 $ hg log -f add0-rm4
1245 $ hg log -f add0-rm4
1246 abort: cannot follow file not in parent revision: "add0-rm4"
1246 abort: cannot follow file not in parent revision: "add0-rm4"
1247 [255]
1247 [20]
1248
1248
1249 $ hg grep --diff -f data add0-rm4
1249 $ hg grep --diff -f data add0-rm4
1250 abort: cannot follow file not in parent revision: "add0-rm4"
1250 abort: cannot follow file not in parent revision: "add0-rm4"
1251 [255]
1251 [20]
1252
1252
1253 BROKEN: should abort
1253 BROKEN: should abort
1254 $ hg grep -f data add0-rm4
1254 $ hg grep -f data add0-rm4
@@ -1340,11 +1340,11 b' follow file history from specified revis'
1340
1340
1341 $ hg log -fr2 add0-rm2
1341 $ hg log -fr2 add0-rm2
1342 abort: cannot follow file not in any of the specified revisions: "add0-rm2"
1342 abort: cannot follow file not in any of the specified revisions: "add0-rm2"
1343 [255]
1343 [20]
1344
1344
1345 $ hg grep --diff -fr2 data add0-rm2
1345 $ hg grep --diff -fr2 data add0-rm2
1346 abort: cannot follow file not in any of the specified revisions: "add0-rm2"
1346 abort: cannot follow file not in any of the specified revisions: "add0-rm2"
1347 [255]
1347 [20]
1348
1348
1349 BROKEN: should abort
1349 BROKEN: should abort
1350 $ hg grep -fr2 data add0-rm2
1350 $ hg grep -fr2 data add0-rm2
@@ -1150,4 +1150,4 b' We get an error for removed files.'
1150 $ hg ci -m 'remove baz' --quiet
1150 $ hg ci -m 'remove baz' --quiet
1151 $ hg log -f -L dir/baz,5:7 -p
1151 $ hg log -f -L dir/baz,5:7 -p
1152 abort: cannot follow file not in parent revision: "dir/baz"
1152 abort: cannot follow file not in parent revision: "dir/baz"
1153 [255]
1153 [20]
@@ -122,13 +122,13 b' log -f empty path (or repo root) shouldn'
122
122
123 $ hg log -qfl1 '' inexistent
123 $ hg log -qfl1 '' inexistent
124 abort: cannot follow file not in parent revision: "inexistent"
124 abort: cannot follow file not in parent revision: "inexistent"
125 [255]
125 [20]
126 $ hg log -qfl1 . inexistent
126 $ hg log -qfl1 . inexistent
127 abort: cannot follow file not in parent revision: "inexistent"
127 abort: cannot follow file not in parent revision: "inexistent"
128 [255]
128 [20]
129 $ hg log -qfl1 "`pwd`" inexistent
129 $ hg log -qfl1 "`pwd`" inexistent
130 abort: cannot follow file not in parent revision: "inexistent"
130 abort: cannot follow file not in parent revision: "inexistent"
131 [255]
131 [20]
132
132
133 $ hg log -qfl1 '' e
133 $ hg log -qfl1 '' e
134 4:7e4639b4691b
134 4:7e4639b4691b
@@ -145,7 +145,7 b' log -f empty path (or repo root) shouldn'
145
145
146 $ hg log -f dir
146 $ hg log -f dir
147 abort: cannot follow file not in parent revision: "dir"
147 abort: cannot follow file not in parent revision: "dir"
148 [255]
148 [20]
149
149
150 -f, directory
150 -f, directory
151
151
@@ -552,7 +552,7 b' follow files from the specified revision'
552
552
553 $ hg log -T '{rev}\n' -fr4 e x
553 $ hg log -T '{rev}\n' -fr4 e x
554 abort: cannot follow file not in any of the specified revisions: "x"
554 abort: cannot follow file not in any of the specified revisions: "x"
555 [255]
555 [20]
556
556
557 follow files from the specified revisions with directory patterns
557 follow files from the specified revisions with directory patterns
558 (BROKEN: should follow copies from dir/b@2)
558 (BROKEN: should follow copies from dir/b@2)
@@ -2422,7 +2422,7 b' follow files from wdir'
2422
2422
2423 $ hg log -T '== {rev} ==\n' -fr'wdir()' --git --stat notfound
2423 $ hg log -T '== {rev} ==\n' -fr'wdir()' --git --stat notfound
2424 abort: cannot follow file not in any of the specified revisions: "notfound"
2424 abort: cannot follow file not in any of the specified revisions: "notfound"
2425 [255]
2425 [20]
2426
2426
2427 follow files from wdir and non-wdir revision:
2427 follow files from wdir and non-wdir revision:
2428
2428
@@ -2435,15 +2435,15 b' follow added/removed files from wdir par'
2435
2435
2436 $ hg log -T '{rev}\n' -f d1/f2
2436 $ hg log -T '{rev}\n' -f d1/f2
2437 abort: cannot follow nonexistent file: "d1/f2"
2437 abort: cannot follow nonexistent file: "d1/f2"
2438 [255]
2438 [20]
2439
2439
2440 $ hg log -T '{rev}\n' -f f1-copy
2440 $ hg log -T '{rev}\n' -f f1-copy
2441 abort: cannot follow nonexistent file: "f1-copy"
2441 abort: cannot follow nonexistent file: "f1-copy"
2442 [255]
2442 [20]
2443
2443
2444 $ hg log -T '{rev}\n' -f .d6/f1
2444 $ hg log -T '{rev}\n' -f .d6/f1
2445 abort: cannot follow file not in parent revision: ".d6/f1"
2445 abort: cannot follow file not in parent revision: ".d6/f1"
2446 [255]
2446 [20]
2447
2447
2448 $ hg revert -aqC
2448 $ hg revert -aqC
2449
2449
General Comments 0
You need to be logged in to leave comments. Login now