Hello Julian,
Here's a failing test for "no dot" case. After removing the code as I wrote
before the test passes.
--
Dmitry Pavlenko,
TMate Software,
http://subgit.com/ - git-svn bridge
> Dmitry Pavlenko wrote:
> > > ... would you mind making a regression test? ...
> >
> > OK, I could do that, but much later, in 2 weeks maybe...
>
> Thanks. I think we should commit your fix anyway, but better if we can also
> fix the 'svn diff' output and also add a test or two.
>
> I am thinking two tests would make sense:
> 1. test that "svn patch" can correctly parse and apply the present form of
> input where there is no dot 2. test that the round-trip of "svn diff"
> followed by "svn patch" works
>
> Maybe I will do some or all of that, soon, but I would love it if anyone
> else wants to take care of it before I get to it.
>
> I have filed this issue as https://issues.apache.org/jira/browse/SVN-4763
>
> - Julian
Index: subversion/tests/cmdline/patch_tests.py
===================================================================
--- subversion/tests/cmdline/patch_tests.py (revision 1836275)
+++ subversion/tests/cmdline/patch_tests.py (working copy)
@@ -7913,6 +7913,49 @@ def patch_empty_prop(sbox):
os.chdir(was_cwd)
+def patch_git_wcroot(sbox):
+ "patch working copy root"
+ sbox.build(empty=True)
+ wc_dir = sbox.wc_dir
+
+ git_patch = [ "Index: .\n",
+ "===================================================================\n",
+ "diff --git a/ b/\n",
+ "--- a/ (revision 0)\n",
+ "+++ b/ (working copy)\n",
+ "Property changes on: \n",
+ "___________________________________________________________________\n",
+ "Added: p\n",
+ "## -0,0 +1 ##\n",
+ "+v\n",
+ "\ No newline at end of property\n",
+ ]
+ value = 'v'
+
+ patch_file_path = sbox.get_tempname('my.patch')
+ svntest.main.file_write(patch_file_path, ''.join(git_patch), 'wb')
+
+ expected_output = wc.State(wc_dir, {
+ '.' : Item(status=' U'),
+ })
+ expected_disk = svntest.wc.State('', {})
+ expected_disk.add({'': Item(props={'p' : value })})
+ expected_status = svntest.wc.State(wc_dir, {})
+ expected_status.add({'': Item(status=' M', wc_rev='0')})
+ expected_skip = wc.State('', { })
+
+ svntest.actions.run_and_verify_patch(wc_dir, patch_file_path,
+ expected_output,
+ expected_disk,
+ expected_status,
+ expected_skip,
+ None, # expected err
+ True, # check-props
+ False, # dry-run
+ )
+
+ svntest.actions.check_prop('p', wc_dir, [value.encode()])
+
########################################################################
#Run the tests
@@ -7998,6 +8041,7 @@ test_list = [ None,
patch_merge,
patch_mergeinfo_in_regular_prop_format,
patch_empty_prop,
+ patch_git_wcroot,
]
if __name__ == '__main__':