You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Alexey Neyman <al...@auriga.ru> on 2006/05/30 14:57:48 UTC

Obtaining the list of added/removed files

Hi, there.

Is it possible to have a list of deleted files between two URLs (and 
revisions)?

Again, the same setup: I imported several large repository snapshots 
on a vendor branch. Then I deleted some files and directories on the 
trunk. Now I'm trying to get a patch agains one of those snapshots of 
vendor sources, in order to merge back to their CVS. The problem is 
that the directory I deleted does not appear in that patch at all.

I searched the mail list archive. It seems that the only suggested 
solution to retrieving the list of deleted/added files is to invoke 
"svn log -q -v" and parse its output. However, this won't work since 
in this setup, the "old" and "new" targets for the diff are at 
different paths in the repository (one is on the vendor branch, the 
other is on the trunk).

Moreover, the "svn log -q -v" lists the entire directory as being 
deleted - meaning there are more stances required to determine the 
actual list of files to be removed.

Any solutions suggested?

Regards,
Alexey.

-- 
... there must always be one Spathi
who picks the short Ta Puun stick.
                        -- Spathi captain Fwiffo, SC2

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

[PATCH] Obtaining the list of added/removed files

Posted by Alexey Neyman <al...@auriga.ru>.
Hi, there

Beginning of the discussion of the problems addressed can be found at:
http://subversion.tigris.org/servlets/ReadMsg?list=users&msgNo=49807
http://subversion.tigris.org/servlets/ReadMsg?list=users&msgNo=49808

On Wednesday 31 May 2006 12:56, Alexey Neyman wrote:
> Unfortunately, I was somewhat quick to reply "everything's 
> alright" :( This hack works for deleted files/directories, but fails 
> for those added: they appear as "A  +" in "svn status" output (that
> is, they are considered to be copied from /trunk to
> /vendor/snapshot1) and therefore are skipped from the "svn diff"
> output. 
> 
> Don't you think it's too much of a nuisance for such a merge:
> 
> $ svn diff file:///svn/vendor/snapshot1 file:///svn/trunk > patch
> < edit patch, leaving only added files >
> $ svn co file:///svn/vendor/snapshot1 tmpdir
> $ cd tmpdir
> $ svn merge file:///svn/vendor/snapshot1 file:///svn/trunk >> patch

Well, I tried to solve it with a patch to Subversion, along with the 
other problem I described. With this patch, it is possible to specify 
what 'svn diff' will print to its output.

Examples:

$ svn diff --diff-format 'prop-change:none'
  (skip property changes from the output)

$ svn diff --diff-format 'prop-change:short'
  (just print the file name and property name, do not print actual
  changes)

$ svn diff --diff-format 'file-added:short,file-changed:short,\
file-deleted:short,dir-added:short,dir-deleted:short,\
prop-changed:short'
  (print just the names of files and directories added/changed/deleted
  or whose properties were changed)

Particularly, the problems I reported are solved by throwing 
--diff-format='prop-changed:none,dir-deleted:short'. The 
--no-diffs-deleted option is a shortcut for --diff-format 
'file-deleted:short', but the option was retained for compatibility.

Of course, the patch is at the "proof of concept" stage. It lacks the 
javadoc-style comments; the svn_opt_parse_diff_format function should 
perhaps reside in libsvn_subr, and so on. I'll polish it later if 
such a feature is welcome.

The patch is against the subversion 1.3.1 and passes 'make check' 
tests ok. Feedback welcome.

Regards,
Alexey.

-- 
First my nest mate surprises me with extra fat and spicy grubs for 
earlymeal...
                        -- Pkunks, SC2



Re: Obtaining the list of added/removed files

Posted by Alexey Neyman <al...@auriga.ru>.
On Wednesday 31 May 2006 12:56, Alexey Neyman wrote:
> Unfortunately, I was somewhat quick to reply "everything's 
> alright" :( This hack works for deleted files/directories, but fails 
> for those added: they appear as "A  +" in "svn status" output (that
> is, they are considered to be copied from /trunk to
> /vendor/snapshot1) and therefore are skipped from the "svn diff"
> output. 
> 
> Don't you think it's too much of a nuisance for such a merge:
> 
> $ svn diff file:///svn/vendor/snapshot1 file:///svn/trunk > patch
> < edit patch, leaving only added files >
> $ svn co file:///svn/vendor/snapshot1 tmpdir
> $ cd tmpdir
> $ svn merge file:///svn/vendor/snapshot1 file:///svn/trunk >> patch

Well, I tried to solve it with a patch to Subversion, along with the 
other problem I described. With this patch, it is possible to specify 
what 'svn diff' will print to its output.

Examples:

$ svn diff --diff-format 'prop-change:none'
  (skip property changes from the output)

$ svn diff --diff-format 'prop-change:short'
  (just print the file name and property name, do not print actual
  changes)

$ svn diff --diff-format 'file-added:short,file-changed:short,\
file-deleted:short,dir-added:short,dir-deleted:short,\
prop-changed:short'
  (print just the names of files and directories added/changed/deleted
  or whose properties were changed)

Particularly, the problems I reported are solved by throwing 
--diff-format='prop-changed:none,dir-deleted:short'. The 
--no-diffs-deleted option is a shortcut for --diff-format 
'file-deleted:short', but the option was retained for compatibility.

Of course, the patch is at the "proof of concept" stage. It lacks the 
javadoc-style comments; the svn_opt_parse_diff_format function should 
perhaps reside in libsvn_subr, and so on. I'll polish it later if 
such a feature is welcome.

The patch is against the subversion 1.3.1 and passes 'make check' 
tests ok. Feedback welcome.

Regards,
Alexey.

-- 
First my nest mate surprises me with extra fat and spicy grubs for 
earlymeal...
                        -- Pkunks, SC2

Re: Obtaining the list of added/removed files

Posted by Alexey Neyman <al...@auriga.ru>.
On Wednesday 31 May 2006 12:56, Alexey Neyman wrote:
> Unfortunately, I was somewhat quick to reply "everything's 
> alright" :( This hack works for deleted files/directories, but fails 
> for those added: they appear as "A  +" in "svn status" output (that
> is, they are considered to be copied from /trunk to
> /vendor/snapshot1) and therefore are skipped from the "svn diff"
> output. 
> 
> Don't you think it's too much of a nuisance for such a merge:
> 
> $ svn diff file:///svn/vendor/snapshot1 file:///svn/trunk > patch
> < edit patch, leaving only added files >
> $ svn co file:///svn/vendor/snapshot1 tmpdir
> $ cd tmpdir
> $ svn merge file:///svn/vendor/snapshot1 file:///svn/trunk >> patch

Well, I tried to solve it with a patch to Subversion, along with the 
other problem I described. With this patch, it is possible to specify 
what 'svn diff' will print to its output.

Examples:

$ svn diff --diff-format 'prop-change:none'
  (skip property changes from the output)

$ svn diff --diff-format 'prop-change:short'
  (just print the file name and property name, do not print actual
  changes)

$ svn diff --diff-format 'file-added:short,file-changed:short,\
file-deleted:short,dir-added:short,dir-deleted:short,\
prop-changed:short'
  (print just the names of files and directories added/changed/deleted
  or whose properties were changed)

Particularly, the problems I reported are solved by throwing 
--diff-format='prop-changed:none,dir-deleted:short'. The 
--no-diffs-deleted option is a shortcut for --diff-format 
'file-deleted:short', but the option was retained for compatibility.

Of course, the patch is at the "proof of concept" stage. It lacks the 
javadoc-style comments; the svn_opt_parse_diff_format function should 
perhaps reside in libsvn_subr, and so on. I'll polish it later if 
such a feature is welcome.

The patch is against the subversion 1.3.1 and passes 'make check' 
tests ok. Feedback welcome.

Regards,
Alexey.

-- 
First my nest mate surprises me with extra fat and spicy grubs for 
earlymeal...
                        -- Pkunks, SC2

Re: Obtaining the list of added/removed files

Posted by Alexey Neyman <al...@auriga.ru>.
On Wednesday 31 May 2006 12:04, Giovanni Bajo wrote:
> Alexey Neyman <al...@auriga.ru> wrote:
> 
> > $ svnadmin create /tmp/svn
> > $ svn mkdir file:///tmp/svn/vendor
> > $ svn import file:///tmp/svn/vendor/current
> > Adding         a
> > Adding         b
> > Adding         b/c
> > Adding         b/d
> > Adding         b/d/g
> > Adding         b/d/h
> > Adding         b/e
> > Adding         b/e/i
> > Adding         b/e/j
> > Adding         b/e/k
> > Adding         b/f
> > Adding         b/f/l
> > Adding         b/f/m
> > $ svn cp file:///tmp/svn/vendor/current \
> >          file:///tmp/svn/vendor/snapshot1
> > $ svn cp file:///tmp/svn/vendor/current \
> >          file:///tmp/svn/trunk
> > $ svn rm file:///tmp/svn/trunk/b/e
> > $ svn diff file:///tmp/svn/vendor/snapshot1 \
> >            file:///tmp/svn/trunk
> >
> > The last 'diff' command shows no changes. However, there are some: 
> > the  copy on the trunk does not contain the files b/e/i, b/e/j,
> > b/e/k - they were removed as they were a part of the b/e
> > directory. It appears there is no way to obtain the list of such
> > changes. 
> 
> 
> What if you checkout snapshot1, do a svn merge 
> file:///tmp/svn/vendor/snapshot1 file:///tmp/svn/trunk, and then svn
> diff? :)

Unfortunately, I was somewhat quick to reply "everything's alright" :(
This hack works for deleted files/directories, but fails for those 
added: they appear as "A  +" in "svn status" output (that is, they 
are considered to be copied from /trunk to /vendor/snapshot1) and 
therefore are skipped from the "svn diff" output.

Don't you think it's too much of a nuisance for such a merge:

$ svn diff file:///svn/vendor/snapshot1 file:///svn/trunk > patch
< edit patch, leaving only added files >
$ svn co file:///svn/vendor/snapshot1 tmpdir
$ cd tmpdir
$ svn merge file:///svn/vendor/snapshot1 file:///svn/trunk >> patch

Regards,
Alexey.

-- 
Open your heart and become one with your happy self.
                        -- Pkunks, SC2

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Obtaining the list of added/removed files

Posted by Alexey Neyman <al...@auriga.ru>.
On Wednesday 31 May 2006 12:04, Giovanni Bajo wrote:
> Alexey Neyman <al...@auriga.ru> wrote:
> 
> > $ svnadmin create /tmp/svn
> > $ svn mkdir file:///tmp/svn/vendor
> > $ svn import file:///tmp/svn/vendor/current
> > Adding         a
> > Adding         b
> > Adding         b/c
> > Adding         b/d
> > Adding         b/d/g
> > Adding         b/d/h
> > Adding         b/e
> > Adding         b/e/i
> > Adding         b/e/j
> > Adding         b/e/k
> > Adding         b/f
> > Adding         b/f/l
> > Adding         b/f/m
> > $ svn cp file:///tmp/svn/vendor/current \
> >          file:///tmp/svn/vendor/snapshot1
> > $ svn cp file:///tmp/svn/vendor/current \
> >          file:///tmp/svn/trunk
> > $ svn rm file:///tmp/svn/trunk/b/e
> > $ svn diff file:///tmp/svn/vendor/snapshot1 \
> >            file:///tmp/svn/trunk
> >
> > The last 'diff' command shows no changes. However, there are some: 
> > the copy on the trunk does not contain the files b/e/i, b/e/j,
> > b/e/k - they were removed as they were a part of the b/e
> > directory. It appears there is no way to obtain the list of such
> > changes. 
> 
> 
> What if you checkout snapshot1, do a svn merge 
> file:///tmp/svn/vendor/snapshot1 file:///tmp/svn/trunk, and then svn
> diff? :) 

Ok, it works, thanks. But it looks more like a hack :)

Regards,
Alexey.

-- 
Your curiosity is understandable.
We are, after all, a fascinating species.
                        -- Pkunks, SC2

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Obtaining the list of added/removed files

Posted by Giovanni Bajo <ra...@develer.com>.
Alexey Neyman <al...@auriga.ru> wrote:

> $ svnadmin create /tmp/svn
> $ svn mkdir file:///tmp/svn/vendor
> $ svn import file:///tmp/svn/vendor/current
> Adding         a
> Adding         b
> Adding         b/c
> Adding         b/d
> Adding         b/d/g
> Adding         b/d/h
> Adding         b/e
> Adding         b/e/i
> Adding         b/e/j
> Adding         b/e/k
> Adding         b/f
> Adding         b/f/l
> Adding         b/f/m
> $ svn cp file:///tmp/svn/vendor/current \
>          file:///tmp/svn/vendor/snapshot1
> $ svn cp file:///tmp/svn/vendor/current \
>          file:///tmp/svn/trunk
> $ svn rm file:///tmp/svn/trunk/b/e
> $ svn diff file:///tmp/svn/vendor/snapshot1 \
>            file:///tmp/svn/trunk
>
> The last 'diff' command shows no changes. However, there are some: the
> copy on the trunk does not contain the files b/e/i, b/e/j, b/e/k -
> they were removed as they were a part of the b/e directory. It
> appears there is no way to obtain the list of such changes.


What if you checkout snapshot1, do a svn merge file:///tmp/svn/vendor/snapshot1
file:///tmp/svn/trunk, and then svn diff? :)

Giovanni Bajo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Obtaining the list of added/removed files

Posted by Alexey Neyman <al...@auriga.ru>.
On Tuesday 30 May 2006 23:46, Giovanni Bajo wrote:
> Alexey Neyman wrote:
> 
>> Again, the same setup: I imported several large repository 
>> snapshots on a vendor branch. Then I deleted some files and
>> directories on the trunk. Now I'm trying to get a patch agains one
>> of those snapshots of vendor sources, in order to merge back to
>> their CVS. The problem is that the directory I deleted does not
>> appear in that patch at all. 
> 
> What is the command you are running? If the original vendor branch 
> is in /vendor/foo, you copied it into /myfoo and modified it there,
> you need something like:
> 
> svn diff http://URL/vendor/foo http://URL/myfoo
> 
> If you instead imported and modified it within the same path (so, 
> say you commit your modifications within /vendor/foo), you want
> something like: 
> 
> svn diff http://URL/vendor/foo@NNN http://URL/vendor/foo@HEAD
> 
> where NNN is the first revision at which /vendor/foo was committed 
> (find it out with svn log).

Thanks, I usually read the manual before troubling the community :) 
Here it is, the problem description step by step:

$ svnadmin create /tmp/svn
$ svn mkdir file:///tmp/svn/vendor
$ svn import file:///tmp/svn/vendor/current
Adding         a
Adding         b
Adding         b/c
Adding         b/d
Adding         b/d/g
Adding         b/d/h
Adding         b/e
Adding         b/e/i
Adding         b/e/j
Adding         b/e/k
Adding         b/f
Adding         b/f/l
Adding         b/f/m
$ svn cp file:///tmp/svn/vendor/current \
         file:///tmp/svn/vendor/snapshot1
$ svn cp file:///tmp/svn/vendor/current \
         file:///tmp/svn/trunk
$ svn rm file:///tmp/svn/trunk/b/e
$ svn diff file:///tmp/svn/vendor/snapshot1 \
           file:///tmp/svn/trunk

The last 'diff' command shows no changes. However, there are some: the 
copy on the trunk does not contain the files b/e/i, b/e/j, b/e/k - 
they were removed as they were a part of the b/e directory. It 
appears there is no way to obtain the list of such changes.

Regards,
Alexey.


-- 
Do not ask favors of people you routinely ambush and murder.
                        -- Spathi captain Fwiffo, SC2

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Obtaining the list of added/removed files

Posted by Giovanni Bajo <ra...@develer.com>.
Alexey Neyman wrote:

> Again, the same setup: I imported several large repository snapshots
> on a vendor branch. Then I deleted some files and directories on the
> trunk. Now I'm trying to get a patch agains one of those snapshots of
> vendor sources, in order to merge back to their CVS. The problem is
> that the directory I deleted does not appear in that patch at all.

What is the command you are running? If the original vendor branch is in
/vendor/foo, you copied it into /myfoo and modified it there, you need
something like:

svn diff http://URL/vendor/foo http://URL/myfoo

If you instead imported and modified it within the same path (so, say you
commit your modifications within /vendor/foo), you want something like:

svn diff http://URL/vendor/foo@NNN http://URL/vendor/foo@HEAD

where NNN is the first revision at which /vendor/foo was committed (find it
out with svn log).
-- 
Giovanni Bajo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org