Re: 'svn patch' issue

2010-07-09 Thread Stefan Sperling
On Fri, Jul 09, 2010 at 12:52:24PM +0300, Daniel Shahaf wrote:
> # no changes between 'diff' and 'patch', so hope for idempotency:
> # for 'patch' to realize the patch is applied and does nothing.

Now I understand. We don't check for already applied patches right now.
Your patch matches with fuzz elsewhere and gets applied there.
This should be fixed.

Stefan


Re: 'svn patch' issue

2010-07-09 Thread Daniel Shahaf
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...@r962376 > before
test -e after  || $svn cat $URL/svnsync_tests...@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 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__':
> > ]]]
> 
> 


Re: 'svn patch' issue

2010-07-09 Thread Stefan Sperling
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.

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__':
> ]]]

-- 
printf("Eh???/n");


'svn patch' issue

2010-07-08 Thread Daniel Shahaf
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':

[[[
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__':
]]]