You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Karl Krach <ma...@blueSpirit.la> on 2012/01/08 09:31:55 UTC

How to get all versions of a file? (incl. branches)

Hello,

I ve created a feature branch with "svn copy" and committed some
content. Afterwards I "merge --reintegrated" this feature branch to the
trunk and deleted it.

In the future, when I do a "svn list ^/branches" this branch is one - of
course, since it's deleted.

1) How can I list all files, which ever were created in a folder?
   $ svn list -r0:HEAD ^/branches
   svn: Revision range is not allowed

2a) If I examine one file in the trunk - how can I get the complete
history (incl. all branches, also the deleted ones)?

2b) Is there a way to figure out the link from TRUNK to BRANCH? When I
create a branch (with svn copy) there is a link from the copy (branch)
to the source (target) by copyfrom_path and copyfrom_rev. But if I
examine the trunk, there is only a link when the branch is merged back
once - if there was no merge, there is no reference to the branch.

The solution does not need a command line, it can also be done in code
(http://subversion.apache.org/docs/api/1.6/group__Log.html#ga6907dbe5f0117b0beee65c41fa6d0837).

Thanks, Charly

Re: How to get all versions of a file? (incl. branches)

Posted by Karl Krach <ma...@blueSpirit.la>.
On 01/08/2012 09:43 AM, Johan Corveleyn wrote:
> In SVN's current implementation, no record is kept of
> "copyto" information.

Thanks Johan. But since there is only a recommendation to create your
branches at ^/branches you could never list all branches (except with
browsing the full log, which is very expensive - especially for big
projects).

I'm just working on a small app to list the revision graph for a
selected folder. If the selected folder is in the trunk, I have no
(clean) chance to find it's branches.

I can guess, that the branches are located in "echo URL | sed
's/trunk.*/branches/" and check relative path there - but what if the
folder was deleted/renamed in this branch? I have to find the
"copy/branch revision" and receive their log history. Each access of the
SVN repository of googlecode takes about 2-3 seconds, this means that
many requests take some time :/

What happens if some stupid guy names the "trunk" as "main line" or
translates the branch-folder into German: "zweige" :)

Charly

Re: How to get all versions of a file? (incl. branches)

Posted by Johan Corveleyn <jc...@gmail.com>.
On Sun, Jan 8, 2012 at 9:31 AM, Karl Krach <ma...@bluespirit.la> wrote:
> Hello,
>
> I ve created a feature branch with "svn copy" and committed some
> content. Afterwards I "merge --reintegrated" this feature branch to the
> trunk and deleted it.
>
> In the future, when I do a "svn list ^/branches" this branch is one - of
> course, since it's deleted.
>
> 1) How can I list all files, which ever were created in a folder?
>   $ svn list -r0:HEAD ^/branches
>   svn: Revision range is not allowed

You'd have to examine / parse the output of 'svn log -r0:HEAD -v
^/branches', to see all the 'Additions' (all lines with an 'A' as
first character).

> 2a) If I examine one file in the trunk - how can I get the complete
> history (incl. all branches, also the deleted ones)?
>
> 2b) Is there a way to figure out the link from TRUNK to BRANCH? When I
> create a branch (with svn copy) there is a link from the copy (branch)
> to the source (target) by copyfrom_path and copyfrom_rev. But if I
> examine the trunk, there is only a link when the branch is merged back
> once - if there was no merge, there is no reference to the branch.

Unfortunately, you can't, except by examining the output of 'svn log
-v' again. In SVN's current implementation, no record is kept of
"copyto" information.

-- 
Johan