Mercurial > public > mercurial-scm > hg
comparison mercurial/destutil.py @ 37002:a72198790e15
show: use the new stack definition for show stack
Now that we have a common stack definition, use it in the hg show stack
command.
Differential Revision: https://phab.mercurial-scm.org/D2397
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Fri, 19 Jan 2018 16:52:56 +0100 |
parents | c5a07a3abe7d |
children | 2987726085c6 |
comparison
equal
deleted
inserted
replaced
37001:407934a97bc7 | 37002:a72198790e15 |
---|---|
11 from . import ( | 11 from . import ( |
12 bookmarks, | 12 bookmarks, |
13 error, | 13 error, |
14 obsutil, | 14 obsutil, |
15 scmutil, | 15 scmutil, |
16 stack | |
16 ) | 17 ) |
17 | 18 |
18 def _destupdateobs(repo, clean): | 19 def _destupdateobs(repo, clean): |
19 """decide of an update destination from obsolescence markers""" | 20 """decide of an update destination from obsolescence markers""" |
20 node = None | 21 node = None |
353 return revs.first() | 354 return revs.first() |
354 | 355 |
355 return None | 356 return None |
356 | 357 |
357 def stackbase(ui, repo): | 358 def stackbase(ui, repo): |
358 # The histedit default base stops at public changesets, branchpoints, | 359 revs = stack.getstack(repo) |
359 # and merges, which is exactly what we want for a stack. | |
360 revs = scmutil.revrange(repo, [histeditdefaultrevset]) | |
361 return revs.last() if revs else None | 360 return revs.last() if revs else None |
362 | 361 |
363 def _statusotherbook(ui, repo): | 362 def _statusotherbook(ui, repo): |
364 bmheads = bookmarks.headsforactive(repo) | 363 bmheads = bookmarks.headsforactive(repo) |
365 curhead = repo[repo._activebookmark].node() | 364 curhead = repo[repo._activebookmark].node() |