Announcement

Collapse
No announcement yet.

How do I totally replace everything in an svn folder and keep my history?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How do I totally replace everything in an svn folder and keep my history?

    Right now im doing this:

    Code:
    svn co https://sdfsdfsd . --force
    svn rm *
    svn add --force .
    svn ci -m 'lsdkjflsdjflsdjf'
    So I want whats in the repo to match the current working copy. When I commit I want to delete any files in the repo that no longer exist in the copy I am commiting. I'm accomplishing this now by just blowing out the whole folder, but when doing this it always says ALL files are updated even though some are the same.

    How can I mirror whats in the current working copy to the repo but also preserve history?

  • #2
    What you ask for is a job for a script. The first part would be to ask Subversion "What is currently different?" - accomplished by the "svn status" command. The output from "svn st -u" would then need to be processed. Each object shown as "removed" (e.g. the '!' character) would need to have "svn rm" executed on them. Each object added would need to have "svn add" executed on them (assuming they were not supposed to be ignored - a related, critical, topic). And so on until the final "svn ci".

    In general, most folks know what they've been changing (or "svn status" will quickly remind them), so the script I'm talking about is almost never needed. Could you say more about your use case?

    Comment


    • #3
      Im in a situation were I need to using svn as a sort of artifact repository - im aware this is not really appropriate but for now this needs to happen.

      Yall got an easy peasy couple of bash lines for me?

      Surely someone has already piped svn st -u to xargs and figured out any formatting weirdness. Love to see a working example if anyones got one!

      Comment

      Working...
      X