[PATCH 2 of 2 V3] switch: add a switch extension to easily move between branches (issue4420)

Piotr Listkiewicz piotr.listkiewicz at gmail.com
Fri Mar 11 03:59:42 EST 2016


>
> I'm not sold on this yet. Can't people run update on shelve by themselve?
> In all cases, It should probably live has a third party extension for a
> while and see if it get traction there.


So i probably i will deploy code to bitbucket, can i add link on
third-party extension section on
https://www.mercurial-scm.org/wiki/UsingExtensions?  Even though i will be
greatful for any additional comment/code review

Urg, we should do the same thing than shelve here. Either shelve is doing
> the right thing and we should rely on it, or shelve is doing something
> wrong and we should fix it.


IMHO i think shelve is doing what is suppose to do, but i don't know what
most user would expect from from branch "switching". I see use cases when
user probably wouldn't like the fact this extension is adding/remove
files(for example when he has local temporary script for sth he doesn't
like to share), but there are use cases when it could be expected - for
example when user rename file and name with old file is removed and new
file is added.

 I would like to discuss those issues, but i don't know if this list is
appropriate for this when we agree switch should be third-party extension

You need locking, but I'm not sure why you need transaction here, you are
> not adding anything to the store, are you? It seems like you are just
> changing the working copy parent and content.


Unfortunately I know nothing about locking/transaction in hg, all code in
switch ext that deals with locking i have done looking at code of other
extensions and doing it to look reasonable and similiar.

2016-03-09 17:48 GMT+01:00 Pierre-Yves David <pierre-yves.david at ens-lyon.org
>:

>
>
> On 03/09/2016 09:37 AM, liscju wrote:
>
>> # HG changeset patch
>> # User liscju <piotr.listkiewicz at gmail.com>
>> # Date 1456130672 -3600
>> #      Mon Feb 22 09:44:32 2016 +0100
>> # Node ID b78377e2f386bd13aa617c257c11e69c1aec34a7
>> # Parent  99d42ff5175af8e03eedb8515395d89c0132319c
>> switch: add a switch extension to easily move between branches (issue4420)
>>
>> This extension allows to switch between branches easily, with
>> saving and restoring working changes using shelve extension.
>> So far this extension is a first  proposal of solution and i am looking
>> forward to opinions,code review and help.
>>
>
> I'm not sold on this yet. Can't people run update on shelve by themselve?
>
> In all cases, It should probably live has a third party extension for a
> while and see if it get traction there.
>
> Without argument switch command shows possible switch destination -
>> other branches. With one argument it shelves current changes, updates
>> to given branch and try to unshelve changes. If there are merge
>> conflicts while unshelving, it saves current switch state, gives user
>> opportunity to resolve conflicts and tries again when user invoke
>> switch --continue.
>>
>> It also gives user chance to abort this operation with switch --abort,
>> that aborts shelve operation, updates to previous node and unshelves
>> last saved shelve. This operation relies on current behaviour of shelve
>> abort that doesn't do any cleanup of old shelves, so last shelved file
>> is always available after running shelve --abort.
>>
>> This implementation marks new/missing files as added/removed before
>> shelving - this behaviour seems resonable to me but im looking forward
>> to opinions about it, especially because it is preserving *.orig files.
>> I have doubts if switch should clean them, and if should then
>> is cleaning all files with orig extension save. Im looking forward to
>> opinions about it.
>>
>
> Urg, we should do the same thing than shelve here. Either shelve is doing
> the right thing and we should rely on it, or shelve is doing something
> wrong and we should fix it.
>
> This solution also needs adding locking and transactions, i need
>> help in those issues because i have very little understanding how
>> locking/transactions works.
>>
>
> You need locking, but I'm not sure why you need transaction here, you are
> not adding anything to the store, are you? It seems like you are just
> changing the working copy parent and content.
>
> --
> Pierre-Yves David
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20160311/c9d8f12e/attachment.html>


More information about the Mercurial-devel mailing list