##// 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 232 return [r for r in subset if r in ps]
233 233
234 234 def parents(repo, subset, x):
235 """``parents(set)``
236 The set of all parents for all changesets in set.
235 """``parents([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 242 ps = set()
239 243 cl = repo.changelog
240 244 for r in getset(repo, range(len(repo)), x):
@@ -21,6 +21,7 b''
21 21 null revision
22 22 $ log 'p1()'
23 23 $ log 'p2()'
24 $ log 'parents()'
24 25
25 26 working dir with a single parent
26 27 $ echo a > a
@@ -28,6 +29,8 b' working dir with a single parent'
28 29 $ log 'p1()'
29 30 0
30 31 $ log 'p2()'
32 $ log 'parents()'
33 0
31 34
32 35 merge in progress
33 36 $ echo b > b
@@ -40,3 +43,6 b' merge in progress'
40 43 2
41 44 $ log 'p2()'
42 45 1
46 $ log 'parents()'
47 2
48 1
General Comments 0
You need to be logged in to leave comments. Login now