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

Re: 'svn patch' issue

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Fri, 9 Jul 2010 12:52:24 +0300 (IDT)

Stefan Sperling wrote on Fri, 9 Jul 2010 at 11:43 +0200:
> On Fri, Jul 09, 2010 at 12:47:05AM +0300, Daniel Shahaf wrote:
> > Working on #3641. I had a changelist containing svnsync_tests.py, two
> > dumpfiles (for the test), and libsvn_repos/replay.c.
> >
> > I saved a diff of the whole CL as ../i3.diff.
> >
> > I 'svn revert'ed replay.c and rebuilt.
> >
> > I then ran 'svn patch ../i3.diff'.
> >
> > Result: one hunk was forcefully re-applied, even though the test file
> > hadn't changed between the 'diff' and the 'patch':
>
> Can you hack up a reproduction script? Thanks.
>

Sure, inlined. I haven't narrowed it down to a minimal example
file, would you prefer me to do that?

[[[
#!/bin/sh

URL=http://svn.apache.org/repos/asf/subversion/trunk/subversion/tests/cmdline

svnadmin=${svnadmin-"svnadmin"}
svn=${svn-"svn"}

test -e before || $svn cat $URL/svnsync_tests.py_at_r962376 > before
test -e after || $svn cat $URL/svnsync_tests.py_at_r962377 > after

rm -rf repos wc
$svnadmin create repos
$svn co -q file://`pwd`/repos wc
cp before wc/iota
$svn add wc/iota
$svn ci -m "add unpatched version" -q wc
cat <after >wc/iota
# svnversion wc/iota == 1M

# no changes between 'diff' and 'patch', so hope for idempotency:
# for 'patch' to realize the patch is applied and does nothing.
cd wc
$svn diff > ../svn-diff
$svn patch ../svn-diff
cd ..

diff -u before after | sed 's/^/EXPECTED: /'
diff -u before wc/iota | sed 's/^/ACTUAL: /'
]]]

> Stefan
>
> >
> > [[[
> > Index: cmdline/svnsync_tests.py
> > ===================================================================
> > --- cmdline/svnsync_tests.py (revision 959212)
> > +++ cmdline/svnsync_tests.py (working copy)
> > @@ -689,6 +689,11 @@ def url_encoding(sbox):
> > "test url encoding issues"
> > run_test(sbox, "url-encoding-bug.dump")
> >
> > +# issue #3641
> > +def descend_into_replace(sbox):
> > + "descending into replaced dir looks in src"
> > + run_test(sbox, "descend_into_replace.dump", subdir='/trunk/H',
> > + exp_dump_file_name = "descend_into_replace.expected.dump")
> >
> > # A test for copying revisions that lack a property that already exists
> > # on the destination rev as part of the commit (i.e. svn:author in this
> > @@ -775,6 +780,11 @@ def commit_a_copy_of_root(sbox):
> > #Testcase for issue 3438.
> > run_test(sbox, "repo_with_copy_of_root_dir.dump")
> >
> > +# issue #3641
> > +def descend_into_replace(sbox):
> > + "descending into replaced dir looks in src"
> > + run_test(sbox, "descend_into_replace.dump", subdir='/trunk/H',
> > + exp_dump_file_name = "descend_into_replace.expected.dump")
> >
> > ########################################################################
> > # Run the tests
> > @@ -815,6 +825,7 @@ test_list = [ None,
> > copy_bad_line_endings,
> > delete_svn_props,
> > commit_a_copy_of_root,
> > + XFail(descend_into_replace),
> > ]
> >
> > if __name__ == '__main__':
> > ]]]
>
>
Received on 2010-07-09 12:10:08 CEST

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