Moves and Renames in Apache Subversion 1.8 - SVNDay 2012

Resources / SVN

108 views
0 Likes
0 0
Apache Subversion represents moves of files and directories as two separate events - a copy event, and a delete event. These events are always processed separately, which usually works fine, except when a move is involved in a tree conflict. Subversion 1.7 is lacking facilities to help users deal with such conflicts, which is a major usability problem. This talk shows how handling of moves has been improved for Subversion 1.8.

Share on Social Networks

Share Link

Use permanent link to share in social media

Share with a friend

Please login to send this presentation by email!

Embed in your website

Select page to start with

15. The 'move' operation in Subversion 1.8 Moves are shown in status output: $ svn move src/clock.c lib/clock.c A lib/clock.c D src/clock.c $ svn status A + lib/clock.c > moved from src/clock.c D src/clock.c > moved to lib/clock.c $ Moves in Subversion 1.8 15/23

16. The 'move' operation in Subversion 1.8 Committing just one half of a move fails: $ svn commit src/clock.c -m "partial commit of a move" svn: E200009: Commit failed (details follow): svn: E200009: Cannot commit 'src/clock.c' because it was moved to 'lib/clock.c' which is not part of the commit; both sides of the move must be committed together $ Moves in Subversion 1.8 16/23

18. Changes in tree-con ict handling Tree con icts involving local moves are labelled correctly: $ svn status A + core/clock.c ! C src/clock.c > local moved away and edited, incoming delete Summary of conflicts: Tree conflicts: 1 $ Moves in Subversion 1.8 18/23

4. Tree-con icts involving moves 1. incoming move vs. local move 2. incoming move vs. local delete 3. incoming move vs. local edit 4. local move vs. incoming move 5. local move vs. incoming delete 6. local move vs. incoming edit In all of these cases the copy+delete concept causes problems. Moves in Subversion 1.8 4/23

1. Moves and Renames in Apache Subversion 1.8 Stefan Sperling < stsp@elego.de > SVN Day 2012 (Jun 14)

6. Example: incoming move vs. local move Harry commits rst $ svn commit -m "move clock code into lib/ directory" Adding lib/clock.c Deleting src/clock.c Committed revision 42. $ Sally's commit is blocked: $ svn commit -m "move clock code into core/ directory" Adding core/clock.c Deleting src/clock.c svn: E155011: Commit failed (details follow): svn: E155011: File 'src/clock.c' is out of date $ Moves in Subversion 1.8 6/23

23. Thank you for your attention Questions? Subversion and the Apache Subversion logo are registered trademarks of The Apache Software Foundation { http://www.apache.org Moves in Subversion 1.8 23/23

17. The 'move' operation in Subversion 1.8 Reverting one half of a move leaves other half as copy or delete $ svn status A + lib/clock.c > moved from src/clock.c D src/clock.c > moved to lib/clock.c $ svn revert lib/clock.c Reverted 'lib/clock.c' $ svn status D src/clock.c $ Moves in Subversion 1.8 17/23

19. Changes in tree-con ict handling Incoming edits follow local moves during update and merge : $ svn status A + lib/clock.c > moved from src/clock.c D src/clock.c > moved to lib/clock.c $ svn update Updating '.': U lib/clock.c Updated to revision 42. $ In 1.7 this was a \local delete vs. incoming edit" con ict. Moves in Subversion 1.8 19/23

7. Example: incoming move vs. local move Sally updates: $ svn update Updating '.': A lib/clock.c C src/clock.c Updated to revision 42. Summary of conflicts: Tree conflicts: 1 $ svn status ! C src/clock.c > local delete, incoming delete upon update A + core/clock.c Summary of conflicts: Tree conflicts: 1 $ core/clock.c is added to Sally's working copy. Con ict described as \incoming delete vs. local delete "! Moves in Subversion 1.8 7/23

9. The 'move' operation in Subversion 1.8 Goals for 1.8.0: Improve behaviour for uncommitted moves in working copy. Prepare client for \Editor v2" 3 rename support. Non-Goals for 1.8.0: Improve behaviour for incoming (i.e. committed) moves Store renames in repository lesystem 3 See Hyrum's \Editor v2" talk. Moves in Subversion 1.8 9/23

20. Changes in tree-con ict handling update auto-resolves incoming deletions on top of local moves 4 Sally moves clock.c and updates: $ svn status A + core/clock.c > moved from src/clock.c D src/clock.c > moved to core/clock.c $ svn update Updating '.': A lib/clock.c <- Harry's move wins D core/clock.c <- Sally's move is undone Updated to revision 42. $ 4 This change is controversial and may not be released in 1.8.0 Moves in Subversion 1.8 20/23

5. Example: incoming move vs. local move Harry wants to move src/clock.c to lib/clock.c $ svn move src/clock.c lib/clock.c A lib/clock.c D src/clock.c $ svn status A + lib/clock.c D src/clock.c $ Sally wants to move src/clock.c to core/clock.c $ svn move src/clock.c core/clock.c A core/clock.c D src/clock.c $ svn status D src/clock.c A + core/clock.c $ Moves in Subversion 1.8 5/23

22. 1.9.0 and beyond These are my personal goals and may not re ect goals of the entire user and developer community. Provide interactive con ict resolution for tree con icts. Needs to be comprehensive { handle any kind of tree con ict. Current tree-con ict behaviour harms user productivity. Try to deliver incremental improvements in every 1.x release. Detect server-side moves during con ict resolution. Scan revision log for server-side moves? 6 Enhance repository format with information about moves? 6 http://svn.apache.org/repos/asf/subversion/branches/moves-scan-log/BRANCH-README Moves in Subversion 1.8 22/23

8. Example: incoming move vs. local move A \delete vs. delete" con ict is agged if: 1. Harry and Sally want to move clock.c to di erent locations 2. Harry and Sally want to delete clock.c Case 1 is a con ict; moves are wrongly labelled \delete\ Case 2 is not a con ict but detected as false positive! ) Modelling a move as copy+delete is insucient. Moves in Subversion 1.8 8/23

2. The 'move' operation in Subversion 1.7 'move' is implemented as copy + delete In Subversion 1.7 these commands are equivalent: svn move alpha beta svn copy alpha beta; svn delete alpha Distinction exists only at the user interface. Committing the delete independently from the copy is possible ) non-atomic move which spans multiple revisions Moves in Subversion 1.8 2/23

11. The NODES table Rows describe nodes ( les and directories) in the working copy. local relpath op depth presence . 0 normal src 0 normal src/clock.c 0 normal Moves in Subversion 1.8 11/23

10. The 'move' operation in Subversion 1.8 Keep copy+delete concept but add annotations for moves Subversion 1.7 already has appropriate columns in .svn/wc.db SQLite database: moved here column in NODES table (boolean) moved to column in NODES table (relative path) These columns are unused in Subversion 1.7. Subversion 1.8 starts using them. Moves in Subversion 1.8 10/23

21. Work left to do for 1.8.0 release Discuss controversial changes in tree con ict behaviour. Some tree con icts not agged anymore ) regression! Enhance svn resolve instead of auto-resolving during update and merge ? Make sure nested moves 5 work correctly. Need to x problems with mixed-revision working copies. 5 http://wiki.apache.org/subversion/MultiLayerMoves Moves in Subversion 1.8 21/23

13. How copy+delete is represented svn copy src/clock.c lib/clock.c svn remove src/clock.c local relpath op depth presence . 0 normal src 0 normal src/clock.c 0 normal src/clock.c 2 base-deleted new row lib/clock.c 2 normal new row Moves in Subversion 1.8 13/23

14. New annotations for moves in 1.8 svn move is now di erent from copy+delete ! svn move src/clock.c lib/src/clock.c local relpath op depth presence moved to moved here . 0 normal src 0 normal src/clock.c 0 normal src/clock.c 2 base-deleted lib/clock.c lib/clock.c 2 normal true Moves in Subversion 1.8 14/23

3. The 'move' operation in Subversion 1.7 'move' as copy+delete works ne for: history tracing during svn log and svn diff svn update and svn merge if there are no con icts During update/merge with incoming moves: The server sends add and delete events 1 in any order. The client cannot relate incoming add and delete events. The client detects tree con icts 2 via delete events only. 1 This will be xed eventually, see Hyrum's \Editor v2" talk. 2 con icting changes to the structure of the versioned directory tree Moves in Subversion 1.8 3/23

12. Understanding \op depth" op depth says at which path component an operation occurred. svn add , delete , and copy add rows with op depth > 0 Example: svn remove src one path component local relpath op depth presence . 0 normal src 0 normal src/clock.c 0 normal src 1 base-deleted new row src/clock.c 1 base-deleted new row Moves in Subversion 1.8 12/23

Views

  • 108 Total Views
  • 76 Website Views
  • 32 Embedded Views

Actions

  • 0 Social Shares
  • 0 Likes
  • 0 Dislikes
  • 0 Comments

Share count

  • 0 Facebook
  • 0 Twitter
  • 0 LinkedIn
  • 0 Google+