Submitter | timeless |
---|---|
Date | May 3, 2016, 4:12 p.m. |
Message ID | <ea8e090238c4bad24784.1462291974@gcc2-power8.osuosl.org> |
Download | mbox | patch |
Permalink | /patch/14866/ |
State | Superseded |
Headers | show |
Comments
Oops. Disregard this series. I'll resend. On Tue, May 3, 2016 at 12:12 PM, timeless <timeless@fmr.im> wrote: > # HG changeset patch > # User timeless <timeless@mozdev.org> > # Date 1462289414 0 > # Tue May 03 15:30:14 2016 +0000 > # Node ID ea8e090238c4bad24784dfccdd679b2cd031acb7 > # Parent 0a6112a63cbbf284ed71912b544d5ec7717a1279 > # Available At bb://timeless/mercurial-crew > # hg pull bb://timeless/mercurial-crew -r ea8e090238c4 > histedit: add implicit base to default plan > > With experimental.histeditng, there is a base command, > in order to faciliate its use, list the implicit base > in the default plan. > > diff -r 0a6112a63cbb -r ea8e090238c4 hgext/histedit.py > --- a/hgext/histedit.py Tue May 03 15:18:01 2016 +0000 > +++ b/hgext/histedit.py Tue May 03 15:30:14 2016 +0000 > @@ -813,6 +813,23 @@ > basectx = self.repo['.'] > return basectx, [] > > + @classmethod > + def initialactions(cls, state, actions): > + """insert the implicit base into the action list > + > + Base lets one set the target for the next action. > + It's helpful to know what that base is, in case you > + are trying to split some commits to that base. > + Also, by showing the action in the plan, it's easier > + for users to understand how to use it.""" > + if not actions: > + return actions > + act = actions[0] > + if not isinstance(act, pick): > + return actions > + act = cls(state, state.repo[act.node].parents()[0]) > + return [act] + actions > + > @action(['_multifold'], > _( > """fold subclass used for when multiple folds happen in a row > @@ -1249,6 +1266,14 @@ > if not rules: > comment = geteditcomment(ui, node.short(root), node.short(topmost)) > actions = [pick(state, r) for r in revs] > + verbs = set() > + for v in actiontable: > + action = actiontable[v] > + verb = action.verb > + if verb in verbs: > + continue > + verbs.add(verb) > + actions = action.initialactions(state, actions) > rules = ruleeditor(repo, ui, actions, comment) > else: > rules = _readfile(rules) > diff -r 0a6112a63cbb -r ea8e090238c4 tests/test-histedit-base.t > --- a/tests/test-histedit-base.t Tue May 03 15:18:01 2016 +0000 > +++ b/tests/test-histedit-base.t Tue May 03 15:30:14 2016 +0000 > @@ -42,6 +42,7 @@ > Verify that implicit base command and help are listed > > $ HGEDITOR=cat hg histedit |grep base > + base 24b6387c8c8c 5 F > # b, base = checkout changeset and apply further changesets from there > > Go to D > _______________________________________________ > Mercurial-devel mailing list > Mercurial-devel@mercurial-scm.org > https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Patch
diff -r 0a6112a63cbb -r ea8e090238c4 hgext/histedit.py --- a/hgext/histedit.py Tue May 03 15:18:01 2016 +0000 +++ b/hgext/histedit.py Tue May 03 15:30:14 2016 +0000 @@ -813,6 +813,23 @@ basectx = self.repo['.'] return basectx, [] + @classmethod + def initialactions(cls, state, actions): + """insert the implicit base into the action list + + Base lets one set the target for the next action. + It's helpful to know what that base is, in case you + are trying to split some commits to that base. + Also, by showing the action in the plan, it's easier + for users to understand how to use it.""" + if not actions: + return actions + act = actions[0] + if not isinstance(act, pick): + return actions + act = cls(state, state.repo[act.node].parents()[0]) + return [act] + actions + @action(['_multifold'], _( """fold subclass used for when multiple folds happen in a row @@ -1249,6 +1266,14 @@ if not rules: comment = geteditcomment(ui, node.short(root), node.short(topmost)) actions = [pick(state, r) for r in revs] + verbs = set() + for v in actiontable: + action = actiontable[v] + verb = action.verb + if verb in verbs: + continue + verbs.add(verb) + actions = action.initialactions(state, actions) rules = ruleeditor(repo, ui, actions, comment) else: rules = _readfile(rules) diff -r 0a6112a63cbb -r ea8e090238c4 tests/test-histedit-base.t --- a/tests/test-histedit-base.t Tue May 03 15:18:01 2016 +0000 +++ b/tests/test-histedit-base.t Tue May 03 15:30:14 2016 +0000 @@ -42,6 +42,7 @@ Verify that implicit base command and help are listed $ HGEDITOR=cat hg histedit |grep base + base 24b6387c8c8c 5 F # b, base = checkout changeset and apply further changesets from there Go to D