Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
720 views
in Technique[技术] by (71.8m points)

svn - Partial Commits with Subversion

Given the case I made two independent changes in one file: eg. added a new method and changed another method.

I often don't want to commit both changes as one commit, but as two independent commits.

On a git repository I would use the Interactive Mode of git-add(1) to split the hunk into smaller ones:

 git add --patch

What's the easiest way to do this with Subversion? (Maybe even using an Eclipse plug-in)

Update:
In The Thing About Git, Ryan calls it: “The Tangled Working Copy Problem.”

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Tortoise SVN 1.8 now supports this with it's "Restore after commit" feature. This allow you to make edits to a file, with all of the edits being undone after the commit

Per the documentation:

To commit only the parts of the file that relate to one specific issue:

  1. in the commit dialog, right-click on file, choose "restore after commit"
  2. edit the file in e.g. TortoiseMerge: undo the changes that you don't want to commit yet
  3. save the file
  4. commit the file

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...