Show More
@@ -910,15 +910,16 b' def first(repo, subset, x, order):' | |||||
910 |
|
910 | |||
911 | def _follow(repo, subset, x, name, followfirst=False): |
|
911 | def _follow(repo, subset, x, name, followfirst=False): | |
912 | args = getargsdict(x, name, 'file startrev') |
|
912 | args = getargsdict(x, name, 'file startrev') | |
913 | c = repo['.'] |
|
913 | revs = None | |
|
914 | if 'startrev' in args: | |||
|
915 | revs = getset(repo, fullreposet(repo), args['startrev']) | |||
|
916 | if not revs: | |||
|
917 | raise error.RepoLookupError( | |||
|
918 | _("%s expected at least one starting revision") % name) | |||
914 | if 'file' in args: |
|
919 | if 'file' in args: | |
915 | x = getstring(args['file'], _("%s expected a pattern") % name) |
|
920 | x = getstring(args['file'], _("%s expected a pattern") % name) | |
916 |
revs |
|
921 | if revs is None: | |
917 | if 'startrev' in args: |
|
922 | revs = [None] | |
918 | revs = getset(repo, fullreposet(repo), args['startrev']) |
|
|||
919 | if not revs: |
|
|||
920 | raise error.RepoLookupError( |
|
|||
921 | _("%s expected at least one starting revision") % name) |
|
|||
922 | fctxs = [] |
|
923 | fctxs = [] | |
923 | for r in revs: |
|
924 | for r in revs: | |
924 | ctx = mctx = repo[r] |
|
925 | ctx = mctx = repo[r] | |
@@ -929,10 +930,9 b' def _follow(repo, subset, x, name, follo' | |||||
929 | fctxs.extend(ctx[f].introfilectx() for f in ctx.manifest().walk(m)) |
|
930 | fctxs.extend(ctx[f].introfilectx() for f in ctx.manifest().walk(m)) | |
930 | s = dagop.filerevancestors(fctxs, followfirst) |
|
931 | s = dagop.filerevancestors(fctxs, followfirst) | |
931 | else: |
|
932 | else: | |
932 |
if |
|
933 | if revs is None: | |
933 | raise error.ParseError(_("%s takes no arguments or a pattern " |
|
934 | revs = baseset([repo['.'].rev()]) | |
934 | "and an optional revset") % name) |
|
935 | s = dagop.revancestors(repo, revs, followfirst) | |
935 | s = dagop.revancestors(repo, baseset([c.rev()]), followfirst) |
|
|||
936 |
|
936 | |||
937 | return subset & s |
|
937 | return subset & s | |
938 |
|
938 |
@@ -748,8 +748,20 b' follow files starting from empty revisio' | |||||
748 | follow starting from revisions: |
|
748 | follow starting from revisions: | |
749 |
|
749 | |||
750 | $ hg log -Gq -r "follow(startrev=2+4)" |
|
750 | $ hg log -Gq -r "follow(startrev=2+4)" | |
751 | hg: parse error: follow takes no arguments or a pattern and an optional revset |
|
751 | o 4:ddb82e70d1a1 | |
752 | [255] |
|
752 | | | |
|
753 | | o 2:60c670bf5b30 | |||
|
754 | | | | |||
|
755 | | o 1:3d5bf5654eda | |||
|
756 | |/ | |||
|
757 | @ 0:67e992f2c4f3 | |||
|
758 | ||||
|
759 | ||||
|
760 | follow the current revision: | |||
|
761 | ||||
|
762 | $ hg log -Gq -r "follow()" | |||
|
763 | @ 0:67e992f2c4f3 | |||
|
764 | ||||
753 |
|
765 | |||
754 | $ hg up -qC 4 |
|
766 | $ hg up -qC 4 | |
755 |
|
767 |
General Comments 0
You need to be logged in to leave comments.
Login now