Make svn diff produce output for new files added on another branch

1,146 views
Skip to first unread message

Stanimir Stamenkov

unread,
Nov 20, 2010, 4:55:51 PM11/20/10
to us...@subversion.apache.org
After merging changes from a branch different from the working one
I could get files added on that other branch, and the svn stat
would look like:

M .
A + a_new_file

Issuing svn diff at this point doesn't include the "a_new_file"
content in the output. Could svn diff be instructed to include the
"a_new_file" content in the output?

Similarly, when working on a feature branch and periodically
syncing with trunk (for example) I often like to compare what I've
got changed on the branch (whether the merge hasn't gone bad, e.g.
after resolving conflicts) before committing the just merged
changes, like:

svn diff --old=^/trunk --new=.

And I get a problem that files which were added on trunk (and just
merged but not committed) appear as deleted in the produced
output. Does this appear as bug?

--
Stanimir

Stanimir Stamenkov

unread,
Nov 20, 2010, 5:03:37 PM11/20/10
to us...@subversion.apache.org
Sat, 20 Nov 2010 23:55:51 +0200, /Stanimir Stamenkov/:

> Similarly, when working on a feature branch and periodically
> syncing with trunk (for example) I often like to compare what I've
> got changed on the branch (whether the merge hasn't gone bad, e.g.
> after resolving conflicts) before committing the just merged
> changes, like:
>
> svn diff --old=^/trunk --new=.
>
> And I get a problem that files which were added on trunk (and just
> merged but not committed) appear as deleted in the produced
> output. Does this appear as bug?

Ah, forget this one. I've just tried and couldn't reproduce it so
it should had been something else.

--
Stanimir

Stefan Sperling

unread,
Nov 20, 2010, 5:45:02 PM11/20/10
to Stanimir Stamenkov, us...@subversion.apache.org
On Sat, Nov 20, 2010 at 11:55:51PM +0200, Stanimir Stamenkov wrote:
> After merging changes from a branch different from the working one
> I could get files added on that other branch, and the svn stat
> would look like:
>
> M .
> A + a_new_file
>
> Issuing svn diff at this point doesn't include the "a_new_file"
> content in the output. Could svn diff be instructed to include the
> "a_new_file" content in the output?

Not with Subversion 1.6 because it always diffs copies against their source.
So you can see modifications you've made after copying, but you cannot
make the copied file appear like an added file in the diff.

In 1.7 there will be a new option which instructs svn diff to show a copy
just like it would show an added file. This option is currently called
--show-copies-as-adds but this name might change before release if we
can come up with a better name. There is a short name for the option
as well, currently --sca.

Stefan

Reply all
Reply to author
Forward
0 new messages