Submitter | Durham Goode |
---|---|
Date | April 15, 2015, 10:55 p.m. |
Message ID | <bf0fdb475857f76b895f.1429138555@dev2000.prn2.facebook.com> |
Download | mbox | patch |
Permalink | /patch/8699/ |
State | Accepted |
Headers | show |
Comments
On 16.04.2015 01:55:55 +0300 Durham Goode <durham@fb.com> wrote: > # HG changeset patch > # User Durham Goode <durham@fb.com> > # Date 1428138773 25200 > # Sat Apr 04 02:12:53 2015 -0700 > # Node ID bf0fdb475857f76b895f799f18ad235a7cb923f2 > # Parent 8416499cacc7b83e364bbd8eaed3b464e229cecd > histedit: improve roll action integration with fold > > Previously the fold action would inspect it's class to figure out if it was a > rollup or not. This was hacky. Now that finishfold is inside the fold class, > let's modify it to check a function (which roll can override) to determine if it > should be prompting for a commit message. 'hg bisect' shows that this revision makes 'roll' command to call an editor, but it shouldn't. > > diff --git a/hgext/histedit.py b/hgext/histedit.py > --- a/hgext/histedit.py > +++ b/hgext/histedit.py > @@ -475,21 +475,20 @@ class fold(histeditaction): > middlecommits = newcommits.copy() > middlecommits.discard(ctx.node()) > > - foldopts = {} > - if isinstance(self, rollup): > - foldopts['rollup'] = True > + return self.finishfold(repo.ui, repo, parentctx, rulectx, ctx.node(), > + middlecommits) > > - return self.finishfold(repo.ui, repo, parentctx, rulectx, ctx.node(), > - foldopts, middlecommits) > + def skipprompt(self): > + return False > > - def finishfold(self, ui, repo, ctx, oldctx, newnode, opts, internalchanges): > + def finishfold(self, ui, repo, ctx, oldctx, newnode, internalchanges): > parent = ctx.parents()[0].node() > hg.update(repo, parent) > ### prepare new commit data > - commitopts = opts.copy() > + commitopts = {} > commitopts['user'] = ctx.user() > # commit message > - if opts.get('rollup'): > + if self.skipprompt(): > newmessage = ctx.description() > else: > newmessage = '\n***\n'.join( > @@ -524,7 +523,8 @@ class fold(histeditaction): > return repo[n], replacements > > class rollup(fold): > - pass > + def skipprompt(self): > + return True > > class drop(histeditaction): > def run(self): > _______________________________________________ > Mercurial-devel mailing list > Mercurial-devel@selenic.com > http://selenic.com/mailman/listinfo/mercurial-devel >
On 04/20/2015 10:05 AM, Alexander Drozdov wrote: > > On 16.04.2015 01:55:55 +0300 Durham Goode <durham@fb.com> wrote: >> # HG changeset patch >> # User Durham Goode <durham@fb.com> >> # Date 1428138773 25200 >> # Sat Apr 04 02:12:53 2015 -0700 >> # Node ID bf0fdb475857f76b895f799f18ad235a7cb923f2 >> # Parent 8416499cacc7b83e364bbd8eaed3b464e229cecd >> histedit: improve roll action integration with fold >> >> Previously the fold action would inspect it's class to figure out if >> it was a >> rollup or not. This was hacky. Now that finishfold is inside the fold >> class, >> let's modify it to check a function (which roll can override) to >> determine if it >> should be prompting for a commit message. > > 'hg bisect' shows that this revision makes 'roll' command to call an > editor, > but it shouldn't. Looks like a regression. Can you file a bug at http://bz.selenic.com/ You, also won a T-Shirt if you do not already own one!
Patch
diff --git a/hgext/histedit.py b/hgext/histedit.py --- a/hgext/histedit.py +++ b/hgext/histedit.py @@ -475,21 +475,20 @@ class fold(histeditaction): middlecommits = newcommits.copy() middlecommits.discard(ctx.node()) - foldopts = {} - if isinstance(self, rollup): - foldopts['rollup'] = True + return self.finishfold(repo.ui, repo, parentctx, rulectx, ctx.node(), + middlecommits) - return self.finishfold(repo.ui, repo, parentctx, rulectx, ctx.node(), - foldopts, middlecommits) + def skipprompt(self): + return False - def finishfold(self, ui, repo, ctx, oldctx, newnode, opts, internalchanges): + def finishfold(self, ui, repo, ctx, oldctx, newnode, internalchanges): parent = ctx.parents()[0].node() hg.update(repo, parent) ### prepare new commit data - commitopts = opts.copy() + commitopts = {} commitopts['user'] = ctx.user() # commit message - if opts.get('rollup'): + if self.skipprompt(): newmessage = ctx.description() else: newmessage = '\n***\n'.join( @@ -524,7 +523,8 @@ class fold(histeditaction): return repo[n], replacements class rollup(fold): - pass + def skipprompt(self): + return True class drop(histeditaction): def run(self):