Re: Shelfing
From: Julian Foad <julian_at_foad.me.uk>
Date: Fri, 14 Sep 2018 10:11:15 +0100
Stefan Kueng wrote on 2018-09-13:
Hi Stefan. I'm delighted to hear you are interested in updating shelving in TSVN.
I'm sure you are not the only person who finds the shelving APIs confusing, so I hope you don't mind me sharing this with the tsvn and svn dev lists.
The Wiki docs might be useful. This page in particular:
> oh, and why was the API renamed from shelve to shelf?
One shelf, many shelves, and the action is to shelve, shelving, shelved. I decided the API naming worked better when based on an object (a "shelf") with actions applied to it (save, apply, unapply, list, drop, and so on).
> * what's the reason for having different versions of one shelf? I think
Checkpointing ( https://issues.apache.org/jira/browse/SVN-3626 ) is enabled by allowing the user to save multiple versions of a shelf, and allowing the user to restore (unshelve) an older version.
The principle is that using shelf versions is equivalent to manually saving patches named "my-change-v1.patch", "my-change-v2.patch", ... and then when the user asks to unshelve "my-change" we give them the latest version by default or an older version if they specify it.
That said, I am already thinking a better API design would have a single-version shelf as its basic unit, and then an API to manage a series of versions with the same base name would be built on top of that basic unit. I filed an issue ( https://issues.apache.org/jira/browse/SVN-4748 ) about that.
> Also I still have no idea on how to implement that in the UI so users
I sketched some suggestions for TortoiseSVN UI dialogues. They are attached to https://issues.apache.org/jira/browse/SVN-3626 .
> Also doesn't this increase the chance of conflicts if
No, because each version is just like a stand-alone shelf. (The versions do not build on top of each other like revision records in a dumpfile do.)
> * what can make a path to get not shelved? Apart from the file not being
A path cannot be shelved if it's copied or moved or is an added or deleted directory, or if it's in a non-committable state such as in conflict. The 'not_shelved_func' callback to svn_client_shelf_save_new_version3() is called in these cases.
> * do you think we should implement the versioning of shelves in TSVN?
Well... you don't have to. It's hard to tell how popular checkpointing might be until people try it. You could just implement unshelving to take the newest version, and not display anything about versions.
> I mean we'd have to use the log dialog as well here, and since a lot of
> * what happens to all the other versions if a version of a shelf is
If you just use svn_client_shelf_apply(), it just copies the changes in the specified version to the WC. All versions are kept in the shelf storage.
The command-line client's "svn unshelve ... VERSION" command deletes newer versions after successfully applying the specified version. That is because I was thinking of it as a "roll back" action. To implement that, the command-line client calls svn_client_shelf_delete_newer_versions(specified_version).
> I'll try to get most of the work done this weekend. So if you have any
Thanks, and I would be very glad to hear more of your suggestions about how to improve the design.
-- - JulianReceived on 2018-09-14 11:11:34 CEST |
This is an archived mail posted to the Subversion Dev mailing list.
This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.