##// END OF EJS Templates
context: follow all branches in blockdescendants()...
Denis Laxalde -
r31955:4c2c30bc default
parent child Browse files
Show More
@@ -1217,16 +1217,18 b' def blockdescendants(fctx, fromline, tol'
1217 seen = {fctx.filerev(): (fctx, (fromline, toline))}
1217 seen = {fctx.filerev(): (fctx, (fromline, toline))}
1218 for i in fl.descendants([fctx.filerev()]):
1218 for i in fl.descendants([fctx.filerev()]):
1219 c = fctx.filectx(i)
1219 c = fctx.filectx(i)
1220 inrange = False
1220 for x in fl.parentrevs(i):
1221 for x in fl.parentrevs(i):
1221 try:
1222 try:
1222 p, linerange2 = seen.pop(x)
1223 p, linerange2 = seen[x]
1223 except KeyError:
1224 except KeyError:
1224 # nullrev or other branch
1225 # nullrev or other branch
1225 continue
1226 continue
1226 inrange, linerange1 = _changesrange(c, p, linerange2, diffopts)
1227 inrangep, linerange1 = _changesrange(c, p, linerange2, diffopts)
1227 if inrange:
1228 inrange = inrange or inrangep
1228 yield c, linerange1
1229 seen[i] = c, linerange1
1229 seen[i] = c, linerange1
1230 if inrange:
1231 yield c, linerange1
1230
1232
1231 class committablectx(basectx):
1233 class committablectx(basectx):
1232 """A committablectx object provides common functionality for a context that
1234 """A committablectx object provides common functionality for a context that
@@ -600,7 +600,28 b' we are missing the branch with rename wh'
600 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 5:7, startrev=25, descend=True)'
600 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 5:7, startrev=25, descend=True)'
601 26: baz:3+->3-
601 26: baz:3+->3-
602
602
603 we follow all branches in descending direction
604 $ hg up 22 --quiet
605 $ sed 's/3/+3/' baz > baz.new
606 $ mv baz.new baz
607 $ hg ci -m 'baz:3->+3'
608 created new head
609 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, startrev=16, descend=True)' --graph
610 @ 29: baz:3->+3
611 :
612 : o 26: baz:3+->3-
613 : :
614 : o 23: baz:3->3+
615 :/
616 o 20: baz:4
617 |\
618 | ~
619 o 19: baz:3
620 |
621 ~
622
603 check error cases
623 check error cases
624 $ hg up 23 --quiet
604 $ hg log -r 'followlines()'
625 $ hg log -r 'followlines()'
605 hg: parse error: followlines takes at least 1 positional arguments
626 hg: parse error: followlines takes at least 1 positional arguments
606 [255]
627 [255]
General Comments 0
You need to be logged in to leave comments. Login now