##// END OF EJS Templates
copies: define a type to return from mergecopies()...
copies: define a type to return from mergecopies() We'll soon return two instances of many of the dicts from `copies.mergecopies()`. That will mean that we need to return 9 different dicts, which is clearly not manageable. This patch instead encapsulates the 4 dicts we'll duplicate in a new type. For now, we still just return one instance of it (plus the separate `diverge` dict). Differential Revision: https://phab.mercurial-scm.org/D7989

File last commit:

r43347:687b865b default
r44660:ece70350 default
Show More
stack.py
24 lines | 757 B | text/x-python | PythonLexer
# stack.py - Mercurial functions for stack definition
#
# Copyright Matt Mackall <mpm@selenic.com> and other
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from __future__ import absolute_import
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 and are not merges.
"""
if rev is None:
rev = b'.'
revspec = b'only(%s) and not public() and not ::merge()'
revisions = repo.revs(revspec, rev)
revisions.sort()
return revisions