tony
tony

Reputation: 2392

Subversion, how can I get from a revision number to a branch?

Our code base has quite a few branches, is there any way I can be given a revision number and from that find which branch the revision number was in?

thanks T

Upvotes: 1

Views: 146

Answers (2)

Lazy Badger
Lazy Badger

Reputation: 97282

is there any way I can be given a revision number and from that find which branch the revision number was in?

No, in common sense - revisions in Subversion are global, per repository (i.e each revision fixes the state of all objects in all nodes of repository)

If your task is "identify, which part of tree was affected by revision N", you have, as @MPi wrote, use svn log -q -v -r N command and get log for the root of repository (i.e no pre-filter for revisions will be applied), piped to grep for extracting only changed files

Upvotes: 4

Michael Piefel
Michael Piefel

Reputation: 19968

In theory, there need not be any connection between a revision number and a branch. One revision can, in fact, commit to many branches (and even tags) at the same time.

However, you can query the log for a certain revision and try to figure out the branch, and if the commits are well-behaved, you will get a decent result:

$ svn log -v -r 91871 # if in working copy
$ svn log -v -r 91871 https://192.0.0.32/repo # with repository URL

Upvotes: 3

Related Questions