Andrew Arthur
Andrew Arthur

Reputation: 1603

How can I find a copy of a deleted branch given a Revision

I have a branch: http://myrepo/Branch1

This branch has 10 revisions: 1-10.

The branch is then copied to the following location: http://myrepo/Branch2

Branch1 is then deleted.

From the 'Show log' dialog of Branch2 it's easy to see all of the Branch1 revisions (By ensuring that 'Stop on copy/rename' is unticked).

However, if I am given a revision such as 5, what's the best way to find a copy of the deleted branch? (In this case Branch2).

Upvotes: 0

Views: 97

Answers (2)

C. Michael Pilato
C. Michael Pilato

Reputation: 136

It appears you are asking essentially about what Subversion developers would refer to as "forward history searching": given a particular path and revision, locate copies made of that path in younger revisions. One practical use of this functionality is, "Hey, I know that version 1412 of ^/trunk/lib/foo.c had a major bug in it -- which of our software's various release branches and tags need to receive a fix for that bug?"

From a core technology perspective, this is challenging because Subversion only internally tracks history in the reverse direction -- for each "node", it knows its ancestors. But successors aren't tracked.

Your reference to "unticking" the "Stop on copy/rename" option leads me to believe that you're using a graphical Subversion UI such as TortoiseSVN. I'm not deeply familiar with that UI, but I have this (ancient) memory that it maintains a local cache of repository history. It's feasible that such a cache could better answer questions of "forward history searching" than Subversion's core APIs and command-line client could, but of course, the TortoiseSVN developers would have to make a conscious decision to expose that functionality.

Short of such a thing, you'd need to find or build tooling that takes, say, the output of svn log -vq on the root of the repository, tracks all copies back through time—building a sort of historical tree for each path—and then allows you to locate a given point on the tree and walk forward in revision time through its various forks and dead-ends while reporting what it finds.

Unfortunately, I know of no such tooling.

Upvotes: 2

Colas
Colas

Reputation: 2076

You should be able to use

svn co http://myrepo/Branch1@5

See also How to "undelete" a deleted folder in Subversion / TortoiseSVN? or Need to restore a deleted branch in Subversion.

Upvotes: 0

Related Questions