开发者

SVN "repair move" from the command-line

开发者 https://www.devze.com 2023-02-05 20:47 出处:网络
My IDE doesn\'t know that I use Subversi开发者_如何学Con, and any time I rename a class (Java) it renames the file without notifying the version control system. I would of course like the file\'s hist

My IDE doesn't know that I use Subversi开发者_如何学Con, and any time I rename a class (Java) it renames the file without notifying the version control system. I would of course like the file's history to be retained. I understand that in TortoiseSVN there is an option called "repair move" that fixes the move, but that's not an option since I'm on Ubuntu. Is there a way to repair the move from the command-line?


If you remember the old name/location of the file:

mv new-filename old-filename
svn mv old-filename new-filename

You, of course, need the Subversion command-line client installed, which you probably have. If not, sudo aptitude install subversion subversion-client should do the trick.

Per your comment, no, I don't know that there is an easier way than this. If you're not sure what your old filename was, svn stat may give you a hint.


Add this to your .bashrc

svn-repair() { mv -n -- "$2" "$1" && svn mv -- "$1" "$2"; }

then you can type

svn-repair old-filename new-filename


Is there a way to repair the move from the command-line?

No, this is SVN issue 1802. It has been open since 2003 so don't hold your breath.

0

精彩评论

暂无评论...
验证码 换一张
取 消