##// END OF EJS Templates
log: make --patch --follow work inside a subdirectory...
Siddharth Agarwal -
r21876:584bbfd1 stable
parent child Browse files
Show More
@@ -1457,7 +1457,7 b' def walkchangerevs(repo, match, opts, pr'
1457
1457
1458 return iterate()
1458 return iterate()
1459
1459
1460 def _makelogfilematcher(repo, pats, followfirst):
1460 def _makelogfilematcher(repo, files, followfirst):
1461 # When displaying a revision with --patch --follow FILE, we have
1461 # When displaying a revision with --patch --follow FILE, we have
1462 # to know which file of the revision must be diffed. With
1462 # to know which file of the revision must be diffed. With
1463 # --follow, we want the names of the ancestors of FILE in the
1463 # --follow, we want the names of the ancestors of FILE in the
@@ -1471,7 +1471,7 b' def _makelogfilematcher(repo, pats, foll'
1471 wctx = repo[None]
1471 wctx = repo[None]
1472
1472
1473 def populate():
1473 def populate():
1474 for fn in pats:
1474 for fn in files:
1475 for i in ((pctx[fn],), pctx[fn].ancestors(followfirst=followfirst)):
1475 for i in ((pctx[fn],), pctx[fn].ancestors(followfirst=followfirst)):
1476 for c in i:
1476 for c in i:
1477 fcache.setdefault(c.linkrev(), set()).add(c.path())
1477 fcache.setdefault(c.linkrev(), set()).add(c.path())
@@ -1596,7 +1596,9 b' def _makelogrevset(repo, pats, opts, rev'
1596 filematcher = None
1596 filematcher = None
1597 if opts.get('patch') or opts.get('stat'):
1597 if opts.get('patch') or opts.get('stat'):
1598 if follow:
1598 if follow:
1599 filematcher = _makelogfilematcher(repo, pats, followfirst)
1599 # _makelogfilematcher expects its files argument to be relative to
1600 # the repo root, so use match.files(), not pats.
1601 filematcher = _makelogfilematcher(repo, match.files(), followfirst)
1600 else:
1602 else:
1601 filematcher = lambda rev: match
1603 filematcher = lambda rev: match
1602
1604
@@ -223,6 +223,43 b' log -pf dir/b'
223 +a
223 +a
224
224
225
225
226 log -pf b inside dir
227
228 $ hg --cwd=dir log -pf b
229 changeset: 2:f8954cd4dc1f
230 user: test
231 date: Thu Jan 01 00:00:03 1970 +0000
232 summary: c
233
234 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
235 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
236 +++ b/dir/b Thu Jan 01 00:00:03 1970 +0000
237 @@ -0,0 +1,1 @@
238 +a
239
240 changeset: 1:d89b0a12d229
241 user: test
242 date: Thu Jan 01 00:00:02 1970 +0000
243 summary: b
244
245 diff -r 9161b9aeaf16 -r d89b0a12d229 b
246 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
247 +++ b/b Thu Jan 01 00:00:02 1970 +0000
248 @@ -0,0 +1,1 @@
249 +a
250
251 changeset: 0:9161b9aeaf16
252 user: test
253 date: Thu Jan 01 00:00:01 1970 +0000
254 summary: a
255
256 diff -r 000000000000 -r 9161b9aeaf16 a
257 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
258 +++ b/a Thu Jan 01 00:00:01 1970 +0000
259 @@ -0,0 +1,1 @@
260 +a
261
262
226 log -vf dir/b
263 log -vf dir/b
227
264
228 $ hg log -vf dir/b
265 $ hg log -vf dir/b
General Comments 0
You need to be logged in to leave comments. Login now