Can I see the svn branch history after I delete a branch?
Asked Answered
C

3

19

I want to delete a svn branch to make sure people don't work on a archived branch by mistake (we have already merged the branch into the trunk).

However, I don't want to loose the branch's history and would ideally still want to be able to see the branch in tortoise svn's graph.

Can I have the best of both world (cleaned up branch's and history)?

Cochise answered 13/11, 2009 at 12:4 Comment(0)
G
21

In the repo-browser, you can look at the log for the 'branches' directory to see in which revision the branch was deleted. You can then use the revision selector in the repo browser (button in the top right, almost certainly says 'HEAD') to look at the previous revision, which will contain the branch as it was just before it was deleted.

From here, you can do what you need to do -- look at the branch in the browser, copy bits elsewhere or even check it out.

Gentille answered 13/11, 2009 at 12:20 Comment(0)
B
3

Even if you delete the branch, the history never disappears. You can probably tell TortoiseSVN's graph function to show you the repository as it existed at a particular revision in the past; this would allow you to see the old history if you really need to.

Brilliancy answered 13/11, 2009 at 12:6 Comment(0)
T
0

As explained by others, you have to find the commit ID where the branch was deleted. Once you have the commit ID, you can use:

svn log -l 10   http://svn.exemple.com/svn/myapp/branches/1.0.0@42983

To find the commit ID, you have two options:

Search the commit ID where the release was created, assuming you know the tag name and you know that tag wasn't updated later:

svn log --stop-on-copy --limit 1 -r0:HEAD   http://svn.exemple.com/svn/myapp/tags/1.0.0

Alternatively, you can search for the commit ID where that branch was deleted (a string like "D /branches/1.0.0") :

svn log --search branches/7.0.0 http://svn.exemple.com/svn/myapp/branches/  -v | grep -e 'D /branches/1.0.0'  -e '^r.*' | grep "D " -B1| head -n 20
Tenace answered 30/11, 2021 at 9:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.