<div dir="ltr">On Wed, May 29, 2013 at 2:28 AM, Bryan O'Sullivan <<a href="mailto:bos@serpentine.com" target="_blank">bos@serpentine.com</a>> wrote:<br>><br>> # HG changeset patch<br>> # User Bryan O'Sullivan <<a href="mailto:bryano@fb.com" target="_blank">bryano@fb.com</a>><br>

> # Date 1369783721 25200<br>> #      Tue May 28 16:28:41 2013 -0700<br>> # Node ID a87ee920b333192898e8ff84e30ddb1ebac515b6<br>> # Parent  11fce4dc68f060e96cc06cc88da72e2c9da1022b<br>> shelve: add a shelve extension to save/restore working changes<br>

><br>> This extension saves shelved changes using a temporary draft commit,<br>> and bundles all draft ancestors of the temporary commit. This<br>> strategy makes it possible to use Mercurial's merge machinery to<br>

> resolve conflicts if necessary when unshelving, even when the<br>> destination commit or its ancestors have been amended, squashed,<br>> or evolved.<div><br></div><div>Nice, this seems to deal with the issues I had with my implementation.</div>

<div><br></div><div>Are you stripping the temporary commit and its bundled ancestors when an unshelve succeeds?</div><div><br></div><div>><br>> Although this extension shares its name and some functionality with<br>

> the third party hgshelve extension, it has little else in common.<br>> Notably, the hgshelve extension shelves changes as unified diffs,<br>> which makes conflict resolution a matter of finding .rej files and<br>

> cleaning up the mess by hand.</div><div><br></div><div>Won't the name conflict cause issues for existing users of hgshelve? Why not call it stash?</div><div><br></div><div>><br>> We do not yet allow hunk-level choosing of changes to record.<br>

> Compared to the hgshelve extension, this is a small regression in<br>> usability, but we hope to integrate that at a later point, once the<br>> record machinery becomes more reusable and robust.<br>><br>> diff --git a/hgext/color.py b/hgext/color.py<br>

> --- a/hgext/color.py<br>> +++ b/hgext/color.py<br>> @@ -63,6 +63,10 @@ Default effects may be overridden from y<br>>    rebase.rebased = blue<br>>    rebase.remaining = red bold<br>><br>> +  shelve.age = cyan<br>

> +  shelve.newest = green bold<br>> +  <a href="http://shelve.name" target="_blank">shelve.name</a> = blue bold<br>> +<br>>    histedit.remaining = red bold<br>><br>>  The available effects in terminfo mode are 'blink', 'bold', 'dim',<br>

> @@ -260,6 +264,9 @@ except ImportError:<br>>             'rebase.remaining': 'red bold',<br>>             'resolve.resolved': 'green bold',<br>>             'resolve.unresolved': 'red bold',<br>

> +           'shelve.age': 'cyan',<br>> +           'shelve.newest': 'green bold',<br>> +           '<a href="http://shelve.name" target="_blank">shelve.name</a>': 'blue bold',<br>

>             'status.added': 'green bold',<br>>             'status.clean': 'none',<br>>             'status.copied': 'none',<br>> diff --git a/hgext/shelve.py b/hgext/shelve.py<br>

> new file mode 100644<br>> --- /dev/null<br>> +++ b/hgext/shelve.py<br>> @@ -0,0 +1,552 @@<br>> +# shelve.py - save/restore working directory state</div><div><br></div><div>Does this file pass tests? There are some unused imports and</div>

<div>commented code here.</div><div><br>[..]</div><div><br>> +<br>> +apply it and make sure our state is as expected<br>> +<br>> +  $ hg unshelve<br>> +  unshelving change 'default-01'<br>> +  adding changesets<br>

> +  adding manifests<br>> +  adding file changes<br>> +  added 1 changesets with 3 changes to 7 files<br>> +  0 files updated, 0 files merged, 0 files removed, 0 files unresolved</div><div><br></div><div>Shouldn't it say 1 files updated here?</div>

<div><br>> +  $ hg status -C<br>> +  M a/a<br>> +  A b.rename/b<br>> +    b/b<br>> +  A c.copy<br>> +    c<br>> +  R b/b<br>> +  $ hg shelve -l<br></div></div>