Show More
@@ -1111,6 +1111,17 b' def walkchangerevs(repo, match, opts, pr' | |||
|
1111 | 1111 | wanted.add(rev) |
|
1112 | 1112 | if copied: |
|
1113 | 1113 | copies.append(copied) |
|
1114 | ||
|
1115 | # We decided to fall back to the slowpath because at least one | |
|
1116 | # of the paths was not a file. Check to see if at least one of them | |
|
1117 | # existed in history, otherwise simply return | |
|
1118 | if slowpath: | |
|
1119 | for path in match.files(): | |
|
1120 | if path == '.' or path in repo.store: | |
|
1121 | break | |
|
1122 | else: | |
|
1123 | return [] | |
|
1124 | ||
|
1114 | 1125 | if slowpath: |
|
1115 | 1126 | # We have to read the changelog to match filenames against |
|
1116 | 1127 | # changed files |
@@ -1286,6 +1297,18 b' def _makegraphlogrevset(repo, pats, opts' | |||
|
1286 | 1297 | raise util.Abort( |
|
1287 | 1298 | _('cannot follow nonexistent file: "%s"') % f) |
|
1288 | 1299 | slowpath = True |
|
1300 | ||
|
1301 | # We decided to fall back to the slowpath because at least one | |
|
1302 | # of the paths was not a file. Check to see if at least one of them | |
|
1303 | # existed in history - in that case, we'll continue down the | |
|
1304 | # slowpath; otherwise, we can turn off the slowpath | |
|
1305 | if slowpath: | |
|
1306 | for path in match.files(): | |
|
1307 | if path == '.' or path in repo.store: | |
|
1308 | break | |
|
1309 | else: | |
|
1310 | slowpath = False | |
|
1311 | ||
|
1289 | 1312 | if slowpath: |
|
1290 | 1313 | # See walkchangerevs() slow path. |
|
1291 | 1314 | # |
@@ -1213,3 +1213,52 b' test in problematic encoding' | |||
|
1213 | 1213 | 1 |
|
1214 | 1214 | |
|
1215 | 1215 | $ cd .. |
|
1216 | ||
|
1217 | test hg log on non-existent files and on directories | |
|
1218 | $ hg init issue1340 | |
|
1219 | $ cd issue1340 | |
|
1220 | $ mkdir d1; mkdir D2; mkdir D3.i; mkdir d4.hg; mkdir d5.d; mkdir .d6 | |
|
1221 | $ echo 1 > d1/f1 | |
|
1222 | $ echo 1 > D2/f1 | |
|
1223 | $ echo 1 > D3.i/f1 | |
|
1224 | $ echo 1 > d4.hg/f1 | |
|
1225 | $ echo 1 > d5.d/f1 | |
|
1226 | $ echo 1 > .d6/f1 | |
|
1227 | $ hg add . | |
|
1228 | adding .d6/f1 | |
|
1229 | adding D2/f1 | |
|
1230 | adding D3.i/f1 | |
|
1231 | adding d1/f1 | |
|
1232 | adding d4.hg/f1 | |
|
1233 | adding d5.d/f1 | |
|
1234 | $ hg commit -m "a bunch of weird directories" | |
|
1235 | $ hg log -l1 d1/f1 | grep changeset | |
|
1236 | changeset: 0:65624cd9070a | |
|
1237 | $ hg log -l1 f1 | |
|
1238 | $ hg log -l1 . | grep changeset | |
|
1239 | changeset: 0:65624cd9070a | |
|
1240 | $ hg log -l1 ./ | grep changeset | |
|
1241 | changeset: 0:65624cd9070a | |
|
1242 | $ hg log -l1 d1 | grep changeset | |
|
1243 | changeset: 0:65624cd9070a | |
|
1244 | $ hg log -l1 D2 | grep changeset | |
|
1245 | changeset: 0:65624cd9070a | |
|
1246 | $ hg log -l1 D2/f1 | grep changeset | |
|
1247 | changeset: 0:65624cd9070a | |
|
1248 | $ hg log -l1 D3.i | grep changeset | |
|
1249 | changeset: 0:65624cd9070a | |
|
1250 | $ hg log -l1 D3.i/f1 | grep changeset | |
|
1251 | changeset: 0:65624cd9070a | |
|
1252 | $ hg log -l1 d4.hg | grep changeset | |
|
1253 | changeset: 0:65624cd9070a | |
|
1254 | $ hg log -l1 d4.hg/f1 | grep changeset | |
|
1255 | changeset: 0:65624cd9070a | |
|
1256 | $ hg log -l1 d5.d | grep changeset | |
|
1257 | changeset: 0:65624cd9070a | |
|
1258 | $ hg log -l1 d5.d/f1 | grep changeset | |
|
1259 | changeset: 0:65624cd9070a | |
|
1260 | $ hg log -l1 .d6 | grep changeset | |
|
1261 | changeset: 0:65624cd9070a | |
|
1262 | $ hg log -l1 .d6/f1 | grep changeset | |
|
1263 | changeset: 0:65624cd9070a | |
|
1264 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now