[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] diff base->repos failed to trace a moved file

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2006-03-13 12:22:36 CET

Malcolm Rowe wrote:
> On Sun, Mar 12, 2006 at 11:27:23PM +0000, Julian Foad wrote:
>
>>Any comments before I commit this?
>>
>
>
> +1, makes sense.
>
>
>>+#----------------------------------------------------------------------
>>+# A base->repos diff of a moved file used to output an all-lines-deleted diff
>>+def diff_base_repos_moved(sbox):
>>+ "base->repos diff of moved file"
>>+
>>+ sbox.build()
>>+
>>+ current_dir = os.getcwd()
>>+ os.chdir(sbox.wc_dir)
>>+ try:
>>+ oldfile = 'iota'
>>+ newfile = 'kappa'
>>+
>>+ # Move, modify and commit a file
>>+ svntest.main.run_svn(None, 'mv', oldfile, newfile)
>>+ open(newfile, 'w').write("new content\n")
>>+ svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m', '')
>>+
>>+ # Check that a base->repos diff shows deleted and added lines.
>>+ # It's not clear whether we expect a file-change diff or
>>+ # a file-delete plus file-add. The former is currently produced if we
>>+ # explicitly request a diff of the file itself, and the latter if we
>>+ # request a tree diff which just happens to contain the file.
>
>
> That's correct. When you select the file itself, you're asking for a
> diff between the file as it exists in BASE (called 'kappa') and the same
> file traced back to r1 (then called 'iota'). So that's a file-change.

Yes.

> However, when you select the directory, you're asking for the changes
> between BASE and r1 of the directory. If diff supports copyfrom (and I
> can't remember whether it does in this specific case), we should see a
> file-change for 'kappa' as above, plus a file-add for 'iota'. If not,
> we should see a file-delete for 'kappa' and a file-add for 'iota'.

 From a high level point of view: why should comparing a directory show changes
to a file in a different way from comparing the file?

 From a low level point of view, "supports copyfrom" is the crucial phrase. I
wonder what we mean by this.

> We should also be able to verify that 'svn diff -r1:BASE' gives the
> opposite diff.

That would be a good test, yes.

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Mar 13 12:23:30 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.