<div dir="ltr"><div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 22, 2019 at 6:35 PM Jordi Gutiérrez Hermoso <<a href="mailto:jordigh@octave.org">jordigh@octave.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"># HG changeset patch<br>
# User Jordi Gutiérrez Hermoso <<a href="mailto:jordigh@octave.org" target="_blank">jordigh@octave.org</a>><br>
# Date 1553268335 14400<br>
#      Fri Mar 22 11:25:35 2019 -0400<br>
# Node ID 6bff7f54a5f20e72e63edbceb2a34d86fb4c86f4<br>
# Parent  773e8b313d28d85002c459ea69d3671e7a0bc05e<br>
shelve: do not update when keeping changes, just set the right parent<br>
<br>
This is not enough to enable `shelve --keep` to work, but it's a<br>
necessary first step.<br></blockquote><div><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Thanks a lot \o/ \o/ \o/</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
diff --git a/hgext/shelve.py b/hgext/shelve.py<br>
--- a/hgext/shelve.py<br>
+++ b/hgext/shelve.py<br>
@@ -506,7 +506,10 @@ def _docreatecmd(ui, repo, pats, opts):<br>
         if ui.formatted():<br>
             desc = stringutil.ellipsis(desc, ui.termwidth())<br>
         ui.status(_('shelved as %s\n') % name)<br>
-        hg.update(repo, parent.node())<br>
+        if opts['keep']:<br>
+            repo.setparents(parent.node(), nodemod.nullid)<br></blockquote><div><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">This function can be used here: <a href="https://www.mercurial-scm.org/repo/hg-committed/file/6fef387af1da/mercurial/scmutil.py#l1257">https://www.mercurial-scm.org/repo/hg-committed/file/6fef387af1da/mercurial/scmutil.py#l1257</a></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">It should make the next patch unrequired.</div></div></div></div>