##// END OF EJS Templates
context.walk: walk all files when file and '.' given...
Martin von Zweigbergk -
r24381:82b82168 default
parent child Browse files
Show More
@@ -588,10 +588,6 b' class changectx(basectx):'
588
588
589 def walk(self, match):
589 def walk(self, match):
590 fset = set(match.files())
590 fset = set(match.files())
591 # for dirstate.walk, files=['.'] means "walk the whole tree".
592 # follow that here, too
593 fset.discard('.')
594
595 # avoid the entire walk if we're only looking for specific files
591 # avoid the entire walk if we're only looking for specific files
596 if fset and not match.anypats():
592 if fset and not match.anypats():
597 if util.all(fn in self for fn in fset):
593 if util.all(fn in self for fn in fset):
@@ -606,6 +602,9 b' class changectx(basectx):'
606 fset.remove(fn)
602 fset.remove(fn)
607 if match(fn):
603 if match(fn):
608 yield fn
604 yield fn
605 # for dirstate.walk, files=['.'] means "walk the whole tree".
606 # follow that here, too
607 fset.discard('.')
609 for fn in sorted(fset):
608 for fn in sorted(fset):
610 if not self.hasdir(fn):
609 if not self.hasdir(fn):
611 match.bad(fn, _('no such file in rev %s') % self)
610 match.bad(fn, _('no such file in rev %s') % self)
@@ -22,10 +22,22 b''
22 $ hg cat -r 1 b
22 $ hg cat -r 1 b
23 1
23 1
24
24
25 Test fileset
25 Test multiple files
26
26
27 $ echo 3 > c
27 $ echo 3 > c
28 $ hg ci -Am addmore c
28 $ hg ci -Am addmore c
29 $ hg cat b c
30 1
31 3
32 $ hg cat .
33 1
34 3
35 $ hg cat . c
36 1
37 3
38
39 Test fileset
40
29 $ hg cat 'set:not(b) or a'
41 $ hg cat 'set:not(b) or a'
30 3
42 3
31 $ hg cat 'set:c or b'
43 $ hg cat 'set:c or b'
General Comments 0
You need to be logged in to leave comments. Login now