0

A teammate of mine accidentally deleted a folder out of a repo, and then just checked out the revision before the deletion and committed the folder and its contents back. But now when I view log for the folder it only shows 1 revision, which is the addition of that folder. If I view log for the entire repo at once, I can see logs past this addition, but I'd like to be able to view logs specifically for certain files in this folder. There is an option "Stop on copy/rename" that is unchecked but doesn't fix the problem. Are there any other options that could show me the logs? Or will I have to do some reverting/merging to get it back to normal?

user3281826
  • 277
  • 1
  • 2
  • 8

1 Answers1

0

You can't get back to the logs for the original files because what you have in the repository are, from the repository's perspective, completely new items. Had your teammate reversed the delete properly in the repository, this wouldn't have happened.

If the contents of this folder haven't been changed since all this happened, you can get the originals back and maintain the history.

  1. Check out the parent folder
  2. Delete the "new" folder that your teammate had re-added
  3. svn copy the deleted item into your working copy - svn cp UTL_TO_DELETED_ITEM@LAST_REV_BEFORE_DELETION -RLAST_REV_BEFORE_DELETION
  4. Commit

If there are changes to this folder since the "wrong" one was committed, copy the folder after step 1 above, and after step 4 copy the changes into your working copy and commit that.

In the future, if someone realizes that they've incorrectly deleted something it can be undone immediately via a reverse merge. technically you could do this now instead of what I outlined above, but the above may prove easier.

alroc
  • 27,574
  • 6
  • 51
  • 97