Unshelve deletes previous version

43 views
Skip to first unread message

Günther DoJoy Humer

unread,
Oct 20, 2022, 1:38:09 PM10/20/22
to TortoiseSVN
I wanted to somehow use Shelving like gits cheap branching. 

Feature shelf, BugFix shelve...

Create a shelveset
Change sth.
Create a new version of the shelveset

work on something different

unshelve version1 of shelveset
Review, commit
unshelve... Version2 is not there anymore!

100% reproducable

Daniel Sahlberg

unread,
Oct 24, 2022, 8:40:03 AM10/24/22
to TortoiseSVN
It seems that unshelving version 1 deletes version 2 but keeps version 1 of the shelf.

I will have to look at this a bit closer as I'm not sure what the proper behaviour should be, neither if this is a flaw in TortoiseSVN or in the Subversion libraries. (Anyone interested should try to reproduce the error on the commandline).

One argument could be that if you decide to go back to shelf version 1, then you have decided that any changes later on are not important anymore. In that case, shelf version 1 should also be deleted. An argument against this is that shelving (opposed to checkpointing) deletes any changes in the WC after moving them to the shelf. But I'm not sure if shelf version 2 is selfcontained or if it stands on top of shelf version 1.

A way to work around this would be to create differently named shelf for each change.

Kind regards,
Daniel

Stefan

unread,
Oct 25, 2022, 1:13:07 PM10/25/22
to TortoiseSVN
the command line client does this as well.
the shelve_restore() function in shelf-cmd.c (in the svn lib) calls svn_client__shelf_delete_newer_versions() after applying the shelf with the selected version.

So I'm guessing that there's a reason for that behavior.

Robert Marr

unread,
Apr 12, 2024, 10:14:29 AMApr 12
to TortoiseSVN
Hey, so I can confirm this is current behavior of V2 as of 1.14.5.  It feels like a bug, but at a bare minimum, something so destructive should issue a warning command.  "Oh, you wanted those other versions you made?  Sorry, GONE"  I'm surprised there's not more people talking about this.
Reply all
Reply to author
Forward
0 new messages