mercurial/destutil.py
changeset 33197 c5a07a3abe7d
parent 33142 4f49810a1011
child 37002 a72198790e15
--- a/mercurial/destutil.py	Wed Jun 28 21:30:46 2017 -0400
+++ b/mercurial/destutil.py	Sat Jul 01 22:38:42 2017 -0700
@@ -354,6 +354,12 @@
 
     return None
 
+def stackbase(ui, repo):
+    # The histedit default base stops at public changesets, branchpoints,
+    # and merges, which is exactly what we want for a stack.
+    revs = scmutil.revrange(repo, [histeditdefaultrevset])
+    return revs.last() if revs else None
+
 def _statusotherbook(ui, repo):
     bmheads = bookmarks.headsforactive(repo)
     curhead = repo[repo._activebookmark].node()