Roll back or revert entire svn repository to an older revision

前端 未结 14 1376
时光取名叫无心
时光取名叫无心 2020-12-04 06:53

I messed up on my SVN repository and now need to revert the entire repository from revision 28 to 24 and don\'t want to deal with diffs or conflicts. Is there a quick and si

14条回答
  •  [愿得一人]
    2020-12-04 07:41

    here is how I would start to do it. Brutal, yes, but its the only thing guaranteed to completely ignore collisions and keep revisions history intact.

      cd /scratchdir 
      svn co -r good svn://repository
      cd /hosed_project
      svn up -r HEAD
      cat >> /tmp/cp.sh 
      ORIG=$1
      TARG=$( echo $ORIG | sed 's/\/scratchdir\///' ); 
      cp $ORIG /hosed_project/$TARG;
      ^D
      chmod u+x /tmp/cp.sh
      find /scratchdir -not -wholename "*/.svn*" -exec /tmp/cp.sh {} \;
    

    Note, this is not the "normal" way IMO, the normal way is to create a branch from an old version, and then merge that branch back in to the head. ( at least, that's how It used to work )

    Edit: the above code is untested, do NOT run it verbatim

提交回复
热议问题