Reputation: 14978
According to this blog post This command should tell me when the release-2.0.2rc1
tag of protobuf was created:
svn log -v -r0:HEAD -l1 --stop-on-copy http://protobuf.googlecode.com/svn/tags/release-2.0.2rc1/
However it does not:
svn log -v -r0:HEAD -l1 --stop-on-copy http://protobuf.googlecode.com/svn/tags/release-2.0.2rc1/
------------------------------------------------------------------------
r54 | [email protected] | 2008-09-29 20:26:43 -0400 (Mon, 29 Sep 2008) | 3 lines
Changed paths:
M /tags/release-2.0.2rc1/configure.ac
M /tags/release-2.0.2rc1/java/pom.xml
M /tags/release-2.0.2rc1/python/setup.py
Update version number in 2.0.2rc1 release branch.
If I look at revision 53, I get the actual copy:
svn log -v -r53 -l1 --stop-on-copy http://protobuf.googlecode.com/svn/
------------------------------------------------------------------------
r53 | [email protected] | 2008-09-29 20:23:29 -0400 (Mon, 29 Sep 2008) | 3 lines
Changed paths:
A /tags/release-2.0.2rc1 (from /trunk:52)
Tagged release candidate 2.0.2rc1.
So that command seems to get me the revision after the copy. How do I get the command that gives me the revision the branch was made?
Upvotes: 3
Views: 1049
Reputation: 52689
What you're doing there is filtering out the whole space of the repo to just your desired branch, and asking 'what's the first revision on that branch'. Now obviously, the previous revision (the one that created it)) is not part of that, because the branch didn't exist before it was created.
So, what the first command does is tell you the initial revision that branch was used - the first commit, or copy. It does not give you the modification to the previous revision (when the branch was added) because that is a modification not of your branch, but of the parent. (think of it like each directory in svn is not a directory you see in explorer where adding a sub-dir is adding a new child, instead think of each directory as a text file with a list of children in it)
For practical purposes it works fine, unless you want to act upon the parent directories (the tags dir) you do not need to find the revision it was branched, the first modification to the branch is all you need, and stop-on-copy gives you that.
Upvotes: 2
Reputation: 14978
This sometimes requires two commands. I didn't go as far as scripting the issue, because my goal was to get this information from SharpSvn not from the SVN command line. However, the procedure to do it from the command line is as follows:
svn log -v -r0:HEAD -l1 --stop-on-copy http://protobuf.googlecode.com/svn/tags/release-2.0.2rc1/
REM inspect the output and see that there is no mention of /tags/release-2.0.2rc1/ being created or copied.
svn log -v -r53:0 -l1 --stop-on-copy http://protobuf.googlecode.com/svn/tags/release-2.0.2rc1/
Upvotes: 2
Reputation: 60413
-l
limits the number of log entries to display so if you have more than one commit youre only going to get the most recent commit. If you ommit -l1
youll get the full list with the last entry being the one in which the branch was created.
Of course your first command would have worked just fine if you were using tags "properly" ie. you only ever have one commit on a tag and that is the copy where you created it. You should never modify a tag after that. Think of them as bookmarks :-)
Upvotes: 1