##// END OF EJS Templates
stack: return a sorted smartrev by default...
Boris Feld -
r37022:68fcc550 default
parent child Browse files
Show More
@@ -359,7 +359,7 b' def desthistedit(ui, repo):'
359
359
360 def stackbase(ui, repo):
360 def stackbase(ui, repo):
361 revs = stack.getstack(repo)
361 revs = stack.getstack(repo)
362 return revs.last() if revs else None
362 return revs.first() if revs else None
363
363
364 def _statusotherbook(ui, repo):
364 def _statusotherbook(ui, repo):
365 bmheads = bookmarks.headsforactive(repo)
365 bmheads = bookmarks.headsforactive(repo)
@@ -13,8 +13,8 b' from . import ('
13 )
13 )
14
14
15 def getstack(repo, rev=None):
15 def getstack(repo, rev=None):
16 """return a smartrev of the stack containing either rev if it is not None
16 """return a sorted smartrev of the stack containing either rev if it is
17 or the current working directory parent.
17 not None or the current working directory parent.
18
18
19 The stack will always contain all drafts changesets which are ancestors to
19 The stack will always contain all drafts changesets which are ancestors to
20 the revision and are not merges.
20 the revision and are not merges.
@@ -24,4 +24,6 b' def getstack(repo, rev=None):'
24
24
25 revspec = 'reverse(only(%s) and not public() and not ::merge())'
25 revspec = 'reverse(only(%s) and not public() and not ::merge())'
26 revset = revsetlang.formatspec(revspec, rev)
26 revset = revsetlang.formatspec(revspec, rev)
27 return scmutil.revrange(repo, [revset])
27 revisions = scmutil.revrange(repo, [revset])
28 revisions.sort()
29 return revisions
@@ -205,13 +205,13 b' Test output'
205 ~
205 ~
206 Check the stack order
206 Check the stack order
207 $ hg log -r "first(stack())"
207 $ hg log -r "first(stack())"
208 10 foo draft c_h
208 9 foo draft c_g
209 $ hg log -r "first(stack(10))"
209 $ hg log -r "first(stack(10))"
210 10 foo draft c_h
210 9 foo draft c_g
211 $ hg log -r "first(stack(8))"
211 $ hg log -r "first(stack(8))"
212 8 foo draft c_f
212 7 foo draft c_e
213 $ hg log -r "first(stack(head()))"
213 $ hg log -r "first(stack(head()))"
214 8 foo draft c_f
214 7 foo draft c_e
215
215
216 Case with multiple heads with unstability involved
216 Case with multiple heads with unstability involved
217 --------------------------------------------------
217 --------------------------------------------------
General Comments 0
You need to be logged in to leave comments. Login now