##// END OF EJS Templates
revsets: let parents() return parents of working dir...
Kevin Bullock -
r12929:515c2786 default
parent child Browse files
Show More
@@ -232,9 +232,13 b' def p2(repo, subset, x):'
232 return [r for r in subset if r in ps]
232 return [r for r in subset if r in ps]
233
233
234 def parents(repo, subset, x):
234 def parents(repo, subset, x):
235 """``parents(set)``
235 """``parents([set])``
236 The set of all parents for all changesets in set.
236 The set of all parents for all changesets in set, or the working directory.
237 """
237 """
238 repo.ui.debug(repr(x), '\n')
239 if x is None:
240 return [r.rev() for r in repo[x].parents()]
241
238 ps = set()
242 ps = set()
239 cl = repo.changelog
243 cl = repo.changelog
240 for r in getset(repo, range(len(repo)), x):
244 for r in getset(repo, range(len(repo)), x):
@@ -21,6 +21,7 b''
21 null revision
21 null revision
22 $ log 'p1()'
22 $ log 'p1()'
23 $ log 'p2()'
23 $ log 'p2()'
24 $ log 'parents()'
24
25
25 working dir with a single parent
26 working dir with a single parent
26 $ echo a > a
27 $ echo a > a
@@ -28,6 +29,8 b' working dir with a single parent'
28 $ log 'p1()'
29 $ log 'p1()'
29 0
30 0
30 $ log 'p2()'
31 $ log 'p2()'
32 $ log 'parents()'
33 0
31
34
32 merge in progress
35 merge in progress
33 $ echo b > b
36 $ echo b > b
@@ -40,3 +43,6 b' merge in progress'
40 2
43 2
41 $ log 'p2()'
44 $ log 'p2()'
42 1
45 1
46 $ log 'parents()'
47 2
48 1
General Comments 0
You need to be logged in to leave comments. Login now