Temporarily put away uncommitted changes in Subversion (a la “git-stash”)

前端 未结 16 1727
轮回少年
轮回少年 2020-11-28 17:18

While programming software stored in a Subversion repo, I often modify some files, then notice that I\'d like to do some preparatory change for my main work. E.g. while impl

16条回答
  •  -上瘾入骨i
    2020-11-28 18:07

    There is a small Python 2 script called svn-stash available under GPL 3: https://github.com/frankcortes/svn-stash .

    It works like the svn diff/patch solutions mentioned and offers pushing and popping of changes as diffs into some local directory. Unfortunately, the stashes can not be named, and only the last one can be popped (well, yeah, it's a stack, but there is no real reason for such a limitation.) But then, you could always build the missing features into the source.

    It is written for *ix, but after replacing every "/" with os.sep it works nicely under Windows as well.

    If you use svn 1.7 or higher, you need to change is_a_current_stash(): remove the line if ".svn" in os.listdir(CURRENT_DIR):, since there is only one top-level .svn subdir in 1.7 WC's.

提交回复
热议问题