<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Mar 5, 2014 at 10:56 PM, David Soria Parra <span dir="ltr"><<a href="mailto:dsp@experimentalworks.net" target="_blank">dsp@experimentalworks.net</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">Olle Lundberg <<a href="mailto:olle.lundberg@gmail.com">olle.lundberg@gmail.com</a>> writes:<br>


<br>
> # HG changeset patch<br>
> # User Olle Lundberg <geek@nerd.sh><br>
> # Date 1394034779 -3600<br>
> #      Wed Mar 05 16:52:59 2014 +0100<br>
> # Node ID cb0ccd948579f1ccbcb39e3749b77268985d0a7b<br>
> # Parent  950c8d5b77e8d5eb610cbea159b7c02387bde211<br>
> histedit: add support for continuing after an exec<br>
><br>
> Bail if there are any uncommited changes/merges in the working<br>
> directory. Else set the currentnode to the working directories<br>
> first parent and let histedit do its magic. Unless the current<br>
> node ctx matches the parent ctx, then we can short circuit the<br>
> logic since there are no changes and we can just return the<br>
> parent with an empty replacements list.<br>
><br>
> diff --git a/hgext/histedit.py b/hgext/histedit.py<br>
> --- a/hgext/histedit.py<br>
> +++ b/hgext/histedit.py<br>
> @@ -664,10 +664,28 @@<br>
>          os.unlink(repo.sjoin('undo'))<br>
><br>
><br>
>  def bootstrapcontinue(ui, repo, parentctx, rules, opts):<br>
>      action, currentnode = rules.pop(0)<br>
> +<br>
> +    # track replacements<br>
> +    replacements = []<br>
> +<br>
> +    if action in ('x', 'exec'):<br>
> +        # TODO: Do we want to auto-commit anything that the exec did for us?<br>
> +        # That would be useful in cases where there is an external tool<br>
> +        # modifying commits for us. The auto-commit behaviour is present in<br>
> +        # the case when a used have used edit to split/add commits. Whatever<br>
> +        # is present in the working dir gets commited.<br>
> +        # If the first parent of the working direcroty is the same as the<br>
> +        # parentctx from the histedit state, we can short circuit the logic<br>
> +        # and just return the parentctx with no replacements.<br>
> +        cmdutil.bailifchanged(repo)<br>
> +        currentnode = repo[None].p1()<br>
> +        if currentnode == parentctx:<br>
> +            return parentctx, replacements<br>
<br>
</div></div>auto commit won't be necessary if we drop locks and allow the command to<br>
commit.<br></blockquote><div>That's only partly true.</div><div>If we end up in a state when the user needs to clean stuff up, but forgets to commit, we either need to bail or go with the edit logic.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


_______________________________________________<br>
Mercurial-devel mailing list<br>
<a href="mailto:Mercurial-devel@selenic.com">Mercurial-devel@selenic.com</a><br>
<a href="http://selenic.com/mailman/listinfo/mercurial-devel" target="_blank">http://selenic.com/mailman/listinfo/mercurial-devel</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Olle
</div></div>