Comments
Patch
@@ -9,28 +9,34 @@
from . import revsetlang, scmutil
-baserevspec = "only(%s) and not public()"
+baserevspec = "not public()"
def getstack(repo, rev=None):
"""return a sorted smartrev of the stack containing either rev if it is
not None or the current working directory parent.
- The stack will always contain all drafts changesets which are ancestors to
- the revision.
+ The stack will always contain all drafts changesets.
There are several config options to restrict the changesets that will be
part of the stack:
[stack]
not-merge = (boolean) # The stack will contains only non-merge changesets
# if set to True (default: True)
+ restrict-ancestors = (boolean) # The stack will contain only the
+ # ancestors of the revision if set to True
+ # (default: True)
"""
if rev is None:
rev = '.'
- revspecargs = [revsetlang.formatspec(baserevspec, rev)]
+ revspecargs = [baserevspec]
revspec = ["%r"]
+ if repo.ui.configbool("stack", "restrict-ancestors"):
+ revspecargs.append(revsetlang.formatspec("only(%s)", rev))
+ revspec.append("%r")
+
if repo.ui.configbool("stack", "not-merge"):
revspecargs.append("not ::merge()")
revspec.append("%r")
@@ -953,6 +953,9 @@
coreconfigitem('stack', 'not-merge',
default=True,
)
+coreconfigitem('stack', 'restrict-ancestors',
+ default=True,
+)
coreconfigitem('subrepos', 'allowed',
default=dynamicdefault, # to make backporting simpler
)