##// END OF EJS Templates
revset: make follow() accept multiple startrevs...
Yuya Nishihara -
r35299:921680c3 default
parent child Browse files
Show More
@@ -914,20 +914,20 b' def _follow(repo, subset, x, name, follo'
914 c = repo['.']
914 c = repo['.']
915 if l:
915 if l:
916 x = getstring(l[0], _("%s expected a pattern") % name)
916 x = getstring(l[0], _("%s expected a pattern") % name)
917 rev = None
917 revs = [None]
918 if len(l) >= 2:
918 if len(l) >= 2:
919 revs = getset(repo, fullreposet(repo), l[1])
919 revs = getset(repo, fullreposet(repo), l[1])
920 if len(revs) != 1:
920 if not revs:
921 raise error.RepoLookupError(
921 raise error.RepoLookupError(
922 _("%s expected one starting revision") % name)
922 _("%s expected at least one starting revision") % name)
923 rev = revs.last()
923 fctxs = []
924 c = repo[rev]
924 for r in revs:
925 matcher = matchmod.match(repo.root, repo.getcwd(), [x],
925 ctx = mctx = repo[r]
926 ctx=repo[rev], default='path')
926 if r is None:
927
927 ctx = repo['.']
928 files = c.manifest().walk(matcher)
928 m = matchmod.match(repo.root, repo.getcwd(), [x],
929
929 ctx=mctx, default='path')
930 fctxs = [c[f].introfilectx() for f in files]
930 fctxs.extend(ctx[f].introfilectx() for f in ctx.manifest().walk(m))
931 s = dagop.filerevancestors(fctxs, followfirst)
931 s = dagop.filerevancestors(fctxs, followfirst)
932 else:
932 else:
933 s = dagop.revancestors(repo, baseset([c.rev()]), followfirst)
933 s = dagop.revancestors(repo, baseset([c.rev()]), followfirst)
@@ -732,6 +732,19 b' log -r "follow(\'set:grep(b2)\', 4)"'
732 date: Thu Jan 01 00:00:01 1970 +0000
732 date: Thu Jan 01 00:00:01 1970 +0000
733 summary: b2
733 summary: b2
734
734
735
736 follow files starting from multiple revisions:
737
738 $ hg log -T '{rev}: {files}\n' -r "follow('glob:b?', 2+3+4)"
739 3: b1
740 4: b2
741
742 follow files starting from empty revision:
743
744 $ hg log -T '{rev}: {files}\n' -r "follow('glob:*', .-.)"
745 abort: follow expected at least one starting revision!
746 [255]
747
735 $ hg up -qC 4
748 $ hg up -qC 4
736
749
737 log -f -r null
750 log -f -r null
General Comments 0
You need to be logged in to leave comments. Login now