Mercurial > hg
changeset 27206:7a523b6d5265
histedit: add tostate method to histedit action
the format of rules that we store in state file format is different from the rule
format that we present to users. We need a way of dumping action to state file.
author | Mateusz Kwapich <mitrandir@fb.com> |
---|---|
date | Wed, 02 Dec 2015 12:19:01 -0800 |
parents | 787d8cc3f04e |
children | 2d8dbeb2462c |
files | hgext/histedit.py |
diffstat | 1 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/histedit.py Wed Dec 02 12:19:01 2015 -0800 +++ b/hgext/histedit.py Wed Dec 02 12:19:01 2015 -0800 @@ -376,6 +376,12 @@ maxlen = max(maxlen, 22) # avoid truncating hash return util.ellipsis(line, maxlen) + def tostate(self): + """Print an action in format used by histedit state files + (the first line is a verb, the remainder is the second) + """ + return "%s\n%s" % (self.verb, node.hex(self.node)) + def constraints(self): """Return a set of constrains that this action should be verified for """