Re: [PATCH] fix repos-to-wc copy dst parents creation

2018-10-15 Thread Branko Čibej
On 14.10.2018 21:39, Nikita Slyusarev wrote:
> 14.10.2018, 17:17, "Branko Čibej" :
> >
> > Hey. Thanks for the nudge.
> >
> > I have just one comment: The two new test scenarios you should be split
> > into their own test cases. Not only is it bad practice to make a test
> > case test more than one scenario, it also defeats parallel test execution.
> >
> Fixed version (the patch is also attached):
> [[[
> Correctly handle existing parent directories when performing repos-to-wc copy.
> * subversion/libsvn_client/copy.c
>(repos_to_wc_copy): If add_parents flag is set and destination parent
>directory exists, but is unversioned, put it under version control. 
> Wc-to-wc
>copy behaves this way, and so should repos-to-wc copy do.
> * subversion/tests/cmdline/copy_tests.py
>(copy_make_parents_repo_wc_existing_unversioned_dst,
> copy_make_parents_wc_wc_existing_unversioned_dst): Check behaviour with 
> dst
>directory pre-creation for both repo-to-wc and wc-to-wc test cases.
> ]]]

r1843888; thanks!

-- Brane



Re: [PATCH] fix repos-to-wc copy dst parents creation

2018-10-14 Thread Nikita Slyusarev
 14.10.2018, 17:17, "Branko Čibej" :Hey. Thanks for the nudge.I have just one comment: The two new test scenarios you should be splitinto their own test cases. Not only is it bad practice to make a testcase test more than one scenario, it also defeats parallel test execution.Fixed version (the patch is also attached): [[[Correctly handle existing parent directories when performing repos-to-wc copy. * subversion/libsvn_client/copy.c  (repos_to_wc_copy): If add_parents flag is set and destination parent  directory exists, but is unversioned, put it under version control. Wc-to-wc  copy behaves this way, and so should repos-to-wc copy do. * subversion/tests/cmdline/copy_tests.py  (copy_make_parents_repo_wc_existing_unversioned_dst,   copy_make_parents_wc_wc_existing_unversioned_dst): Check behaviour with dst  directory pre-creation for both repo-to-wc and wc-to-wc test cases.]]] -- Nikita SlyusarevYandex Index: subversion/libsvn_client/copy.c
===
--- subversion/libsvn_client/copy.c	(revision 1843859)
+++ subversion/libsvn_client/copy.c	(working copy)
@@ -2742,6 +2742,16 @@ repos_to_wc_copy(svn_boolean_t *timestamp_sleep,
   SVN_ERR(svn_client__make_local_parents(dst_parent, TRUE, ctx,
  iterpool));
 }
+  else if (make_parents && dst_parent_kind == svn_node_dir)
+{
+  SVN_ERR(svn_wc_read_kind2(&dst_parent_kind, ctx->wc_ctx, dst_parent,
+FALSE, TRUE, iterpool));
+  if (dst_parent_kind == svn_node_none)
+{
+  SVN_ERR(svn_client__make_local_parents(dst_parent, TRUE, ctx,
+ iterpool));
+}
+}
   else if (dst_parent_kind != svn_node_dir)
 {
   return svn_error_createf(SVN_ERR_WC_NOT_WORKING_COPY, NULL,
Index: subversion/tests/cmdline/copy_tests.py
===
--- subversion/tests/cmdline/copy_tests.py	(revision 1843859)
+++ subversion/tests/cmdline/copy_tests.py	(working copy)
@@ -3504,7 +3504,51 @@ def copy_make_parents_wc_wc(sbox):
 expected_output,
 expected_status)
 
+
 #--
+# Test copying and creating parents in the wc with dst directory being
+# precreated and unversioned
+
+def copy_make_parents_wc_wc_existing_unversioned_dst(sbox):
+  "svn cp --parents WC_PATH WC_PATH (ex. unver. dst)"
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  iota_path = sbox.ospath('iota')
+  new_iota_path = sbox.ospath('X/Y/Z/iota')
+  os.makedirs(os.path.dirname(new_iota_path))
+
+  # Copy iota
+  svntest.actions.run_and_verify_svn(None, [],
+ 'cp', '--parents',
+ iota_path, new_iota_path)
+
+  # Create expected output
+  expected_output = svntest.wc.State(wc_dir, {
+'X'  : Item(verb='Adding'),
+'X/Y': Item(verb='Adding'),
+'X/Y/Z'  : Item(verb='Adding'),
+'X/Y/Z/iota' : Item(verb='Adding'),
+})
+
+  # Create expected status tree
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+
+  # Add the moved files
+  expected_status.add({
+'X'   : Item(status='  ', wc_rev=2),
+'X/Y' : Item(status='  ', wc_rev=2),
+'X/Y/Z'   : Item(status='  ', wc_rev=2),
+'X/Y/Z/iota'  : Item(status='  ', wc_rev=2),
+})
+
+  svntest.actions.run_and_verify_commit(wc_dir,
+expected_output,
+expected_status)
+
+
+#--
 # Test copying and creating parents from the repo to the wc
 
 def copy_make_parents_repo_wc(sbox):
@@ -3546,6 +3590,49 @@ def copy_make_parents_repo_wc(sbox):
 
 
 #--
+# Test copying and creating parents from the repo to the wc with dst
+# directory being precreated and unversioned
+
+def copy_make_parents_repo_wc_existing_unversioned_dst(sbox):
+  "svn cp --parents URL WC_PATH with (ex. unver. dst)"
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  iota_url = sbox.repo_url + '/iota'
+  new_iota_path = sbox.ospath('X/Y/Z/iota')
+  os.makedirs(os.path.dirname(new_iota_path))
+
+  # Copy iota
+  svntest.actions.run_and_verify_svn(None, [],
+ 'cp', '--parents',
+ iota_url, new_iota_path)
+
+  # Create expected output
+  expected_output = svntest.wc.State(wc_dir, {
+'X'   : Item(verb='Adding'),
+'X/Y' : Item(verb='Adding'),
+'X/Y/Z'   : Item(verb='Adding'),
+'X/Y/Z/iota'  : Item(verb='Adding'),
+})
+
+  # Create expected status tree
+  expected_status = svntest.a

Re: [PATCH] fix repos-to-wc copy dst parents creation

2018-10-14 Thread Nikita Slyusarev
 14.10.2018, 17:17, "Branko Čibej" :Hey. Thanks for the nudge.I have just one comment: The two new test scenarios you should be splitinto their own test cases. Not only is it bad practice to make a testcase test more than one scenario, it also defeats parallel test execution.Ok, sure. -- Nikita SlyusarevYandex 


Re: [PATCH] fix repos-to-wc copy dst parents creation

2018-10-14 Thread Branko Čibej
On 14.10.2018 15:48, Nikita Slyusarev wrote:
>  
> 04.08.2018, 17:47, "Nikita Slyusarev" :
>>
>> For everyone's sanity I'd better not only bump the thread, but also
>> resend the patch and the log message I had prepared back then.
>>
>> 14.07.2018, 19:04, "Nikita Slyusarev" > >:
>>
>>  
>>
>> [[[
>> Correctly handle existing parent directories when performing
>> repos-to-wc copy.
>>
>> * subversion/libsvn_client/copy.c
>>   (repos_to_wc_copy): If add_parents flag is set and destination
>> parent
>>   directory exists, but is unversioned, put it under version
>> control. Wc-to-wc
>>   copy behaves this way, and so should repos-to-wc copy do.
>>
>> * subversion/tests/cmdline/copy_tests.py
>>   (copy_make_parents_repo_wc,
>>    copy_make_parents_wc_wc): Check behaviour with dst directory
>> pre-creation
>>   for both repo-to-wc and wc-to-wc test cases.
>> ]]]
>>  
>>
>  
>  
> Hello, guys, any hope to get this reviewed?


Hey. Thanks for the nudge.

I have just one comment: The two new test scenarios you should be split
into their own test cases. Not only is it bad practice to make a test
case test more than one scenario, it also defeats parallel test execution.

-- Brane



Re: [PATCH] fix repos-to-wc copy dst parents creation

2018-10-14 Thread Nikita Slyusarev
 04.08.2018, 17:47, "Nikita Slyusarev" :For everyone's sanity I'd better not only bump the thread, but also resend the patch and the log message I had prepared back then.14.07.2018, 19:04, "Nikita Slyusarev" : [[[Correctly handle existing parent directories when performing repos-to-wc copy.* subversion/libsvn_client/copy.c  (repos_to_wc_copy): If add_parents flag is set and destination parent  directory exists, but is unversioned, put it under version control. Wc-to-wc  copy behaves this way, and so should repos-to-wc copy do.* subversion/tests/cmdline/copy_tests.py  (copy_make_parents_repo_wc,   copy_make_parents_wc_wc): Check behaviour with dst directory pre-creation  for both repo-to-wc and wc-to-wc test cases.]]]   Hello, guys, any hope to get this reviewed? -- Nikita SlyusarevYandex 

Re: [PATCH] fix repos-to-wc copy dst parents creation

2018-08-13 Thread Julian Foad
> Nikita Slyusarev wrote on 04 Aug 2018:
> > For everyone's sanity I'd better not only bump the thread, but also 
> > resend the patch and the log message I had prepared back then.

Daniel Shahaf wrote:
> Filed SVN-4768.  If anyone could review the patch, that'd be great;

Thank you Nikita for continuing to push this. We are grateful for your 
contribution, and only limited by having very few active contributors. I have 
your email marked for attention in my mail box. I will make sure I get to it 
soon-ish if nobody else does.

-- 
- Julian


Re: [PATCH] fix repos-to-wc copy dst parents creation

2018-08-13 Thread Daniel Shahaf
Nikita Slyusarev wrote on Sat, 04 Aug 2018 17:47 +0300:
> For everyone's sanity I'd better not only bump the thread, but also 
> resend the patch and the log message I had prepared back then.
> 

Filed SVN-4768.  If anyone could review the patch, that'd be great;
it's a one-liner fix with a test...

> [[[
> Correctly handle existing parent directories when performing repos-to-wc copy.
> 
> * subversion/libsvn_client/copy.c
>   (repos_to_wc_copy): If add_parents flag is set and destination parent
>   directory exists, but is unversioned, put it under version control. Wc-to-wc
>   copy behaves this way, and so should repos-to-wc copy do.
> 
> * subversion/tests/cmdline/copy_tests.py
>   (copy_make_parents_repo_wc,
>    copy_make_parents_wc_wc): Check behaviour with dst directory pre-creation
>   for both repo-to-wc and wc-to-wc test cases.
> ]]]
> 
> Email had 1 attachment:
> + subversion-libsvn_client-copy-with_tests.patch
>   6k (text/x-diff)


Re: [PATCH] fix repos-to-wc copy dst parents creation

2018-08-04 Thread Nikita Slyusarev
For everyone's sanity I'd better not only bump the thread, but also resend the 
patch and the log message I had prepared back then.

14.07.2018, 19:04, "Nikita Slyusarev" :
> 14.07.2018, 17:18, "Daniel Shahaf" :
>>  It would help to add a regression test to subversion/tests/cmdline/ or
>>  subversion/tests/libsvn_client/.
>
> Thanks for your advice. I've added cmdline tests to the patch and fixed the 
> log
> message accordingly.

[[[
Correctly handle existing parent directories when performing repos-to-wc copy.

* subversion/libsvn_client/copy.c
  (repos_to_wc_copy): If add_parents flag is set and destination parent
  directory exists, but is unversioned, put it under version control. Wc-to-wc
  copy behaves this way, and so should repos-to-wc copy do.

* subversion/tests/cmdline/copy_tests.py
  (copy_make_parents_repo_wc,
   copy_make_parents_wc_wc): Check behaviour with dst directory pre-creation
  for both repo-to-wc and wc-to-wc test cases.
]]]

-- 
Nikita Slyusarev
Yandex

Index: subversion/libsvn_client/copy.c
===
--- subversion/libsvn_client/copy.c	(revision 1835910)
+++ subversion/libsvn_client/copy.c	(working copy)
@@ -2742,6 +2742,16 @@ repos_to_wc_copy(svn_boolean_t *timestamp_sleep,
   SVN_ERR(svn_client__make_local_parents(dst_parent, TRUE, ctx,
  iterpool));
 }
+  else if (make_parents && dst_parent_kind == svn_node_dir)
+{
+  SVN_ERR(svn_wc_read_kind2(&dst_parent_kind, ctx->wc_ctx, dst_parent,
+FALSE, TRUE, iterpool));
+  if (dst_parent_kind == svn_node_none)
+{
+  SVN_ERR(svn_client__make_local_parents(dst_parent, TRUE, ctx,
+ iterpool));
+}
+}
   else if (dst_parent_kind != svn_node_dir)
 {
   return svn_error_createf(SVN_ERR_WC_NOT_WORKING_COPY, NULL,
Index: subversion/tests/cmdline/copy_tests.py
===
--- subversion/tests/cmdline/copy_tests.py	(revision 1835910)
+++ subversion/tests/cmdline/copy_tests.py	(working copy)
@@ -3477,10 +3477,19 @@ def copy_make_parents_wc_wc(sbox):
   iota_path = sbox.ospath('iota')
   new_iota_path = sbox.ospath('X/Y/Z/iota')
 
+  # Existing unversioned dst directory case
+  new_iota_path_eudst = sbox.ospath('X2/Y/Z/iota')
+  os.makedirs(os.path.dirname(new_iota_path_eudst))
+
   # Copy iota
   svntest.actions.run_and_verify_svn(None, [], 'cp', '--parents',
  iota_path, new_iota_path)
 
+  # Copy iota to pre-created dst directory
+  svntest.actions.run_and_verify_svn(None, [],
+ 'cp', '--parents',
+ iota_path, new_iota_path_eudst)
+
   # Create expected output
   expected_output = svntest.wc.State(wc_dir, {
 'X'   : Item(verb='Adding'),
@@ -3487,6 +3496,10 @@ def copy_make_parents_wc_wc(sbox):
 'X/Y' : Item(verb='Adding'),
 'X/Y/Z'   : Item(verb='Adding'),
 'X/Y/Z/iota'  : Item(verb='Adding'),
+'X2'  : Item(verb='Adding'),
+'X2/Y': Item(verb='Adding'),
+'X2/Y/Z'  : Item(verb='Adding'),
+'X2/Y/Z/iota' : Item(verb='Adding'),
 })
 
   # Create expected status tree
@@ -3498,6 +3511,10 @@ def copy_make_parents_wc_wc(sbox):
 'X/Y' : Item(status='  ', wc_rev=2),
 'X/Y/Z'   : Item(status='  ', wc_rev=2),
 'X/Y/Z/iota'  : Item(status='  ', wc_rev=2),
+'X2'  : Item(status='  ', wc_rev=2),
+'X2/Y': Item(status='  ', wc_rev=2),
+'X2/Y/Z'  : Item(status='  ', wc_rev=2),
+'X2/Y/Z/iota' : Item(status='  ', wc_rev=2),
 })
 
   svntest.actions.run_and_verify_commit(wc_dir,
@@ -3516,11 +3533,20 @@ def copy_make_parents_repo_wc(sbox):
   iota_url = sbox.repo_url + '/iota'
   new_iota_path = sbox.ospath('X/Y/Z/iota')
 
+  # Existing unversioned dst directory case
+  new_iota_path_eudst = sbox.ospath('X2/Y/Z/iota')
+  os.makedirs(os.path.dirname(new_iota_path_eudst))
+
   # Copy iota
   svntest.actions.run_and_verify_svn(None, [],
  'cp', '--parents',
  iota_url, new_iota_path)
 
+  # Copy iota to pre-created dst directory
+  svntest.actions.run_and_verify_svn(None, [],
+ 'cp', '--parents',
+ iota_url, new_iota_path_eudst)
+
   # Create expected output
   expected_output = svntest.wc.State(wc_dir, {
 'X'   : Item(verb='Adding'),
@@ -3527,6 +3553,10 @@ def copy_make_parents_repo_wc(sbox):
 'X/Y' : Item(verb='Adding'),
 'X/Y/Z'   : Item(verb='Adding'),
 'X/Y/Z/iota'  : Item(verb='Adding'),
+'X2'  : Item(verb='Adding'),
+'X2/Y': Item(verb='Adding'),
+'X2/Y/Z'  : Item

Re: [PATCH] fix repos-to-wc copy dst parents creation

2018-08-04 Thread Nikita Slyusarev
Bump?

20.07.2018, 11:04, "Nikita Slyusarev" :
> 14.07.2018, 20:05, "Daniel Shahaf" :
>>  The submission includes a log message and an explanation of the problem. In
>>  that regard it is complete and ready for review. That will hopefully happen 
>> on
>>  Monday. Should you not get a response, do prod us again.
>
> Hello. Any news with the review process?
> Not to be bothersome or to hurry, but to ensure that the submission is not 
> lost.

-- 
Nikita Slyusarev
Yandex


Re: [PATCH] fix repos-to-wc copy dst parents creation

2018-07-20 Thread Nikita Slyusarev



14.07.2018, 20:05, "Daniel Shahaf" :
> The submission includes a log message and an explanation of the problem. In
> that regard it is complete and ready for review. That will hopefully happen on
> Monday. Should you not get a response, do prod us again.

Hello. Any news with the review process?
Not to be bothersome or to hurry, but to ensure that the submission is not lost.

-- 
Nikita Slyusarev
Yandex


Re: [PATCH] fix repos-to-wc copy dst parents creation

2018-07-14 Thread Nikita Slyusarev
14.07.2018, 17:18, "Daniel Shahaf" :
> It would help to add a regression test to subversion/tests/cmdline/ or
> subversion/tests/libsvn_client/.

Thanks for your advice. I've added cmdline tests to the patch and fixed the log
message accordingly.

[[[
Correctly handle existing parent directories when performing repos-to-wc copy.

* subversion/libsvn_client/copy.c
  (repos_to_wc_copy): If add_parents flag is set and destination parent
  directory exists, but is unversioned, put it under version control. Wc-to-wc
  copy behaves this way, and so should repos-to-wc copy do.

* subversion/tests/cmdline/copy_tests.py
  (copy_make_parents_repo_wc,
   copy_make_parents_wc_wc): Check behaviour with dst directory pre-creation
  for both repo-to-wc and wc-to-wc test cases.
]]]

-- 
Nikita Slyusarev
Yandex
Index: subversion/libsvn_client/copy.c
===
--- subversion/libsvn_client/copy.c	(revision 1835910)
+++ subversion/libsvn_client/copy.c	(working copy)
@@ -2742,6 +2742,16 @@ repos_to_wc_copy(svn_boolean_t *timestamp_sleep,
   SVN_ERR(svn_client__make_local_parents(dst_parent, TRUE, ctx,
  iterpool));
 }
+  else if (make_parents && dst_parent_kind == svn_node_dir)
+{
+  SVN_ERR(svn_wc_read_kind2(&dst_parent_kind, ctx->wc_ctx, dst_parent,
+FALSE, TRUE, iterpool));
+  if (dst_parent_kind == svn_node_none)
+{
+  SVN_ERR(svn_client__make_local_parents(dst_parent, TRUE, ctx,
+ iterpool));
+}
+}
   else if (dst_parent_kind != svn_node_dir)
 {
   return svn_error_createf(SVN_ERR_WC_NOT_WORKING_COPY, NULL,
Index: subversion/tests/cmdline/copy_tests.py
===
--- subversion/tests/cmdline/copy_tests.py	(revision 1835910)
+++ subversion/tests/cmdline/copy_tests.py	(working copy)
@@ -3477,10 +3477,19 @@ def copy_make_parents_wc_wc(sbox):
   iota_path = sbox.ospath('iota')
   new_iota_path = sbox.ospath('X/Y/Z/iota')
 
+  # Existing unversioned dst directory case
+  new_iota_path_eudst = sbox.ospath('X2/Y/Z/iota')
+  os.makedirs(os.path.dirname(new_iota_path_eudst))
+
   # Copy iota
   svntest.actions.run_and_verify_svn(None, [], 'cp', '--parents',
  iota_path, new_iota_path)
 
+  # Copy iota to pre-created dst directory
+  svntest.actions.run_and_verify_svn(None, [],
+ 'cp', '--parents',
+ iota_path, new_iota_path_eudst)
+
   # Create expected output
   expected_output = svntest.wc.State(wc_dir, {
 'X'   : Item(verb='Adding'),
@@ -3487,6 +3496,10 @@ def copy_make_parents_wc_wc(sbox):
 'X/Y' : Item(verb='Adding'),
 'X/Y/Z'   : Item(verb='Adding'),
 'X/Y/Z/iota'  : Item(verb='Adding'),
+'X2'  : Item(verb='Adding'),
+'X2/Y': Item(verb='Adding'),
+'X2/Y/Z'  : Item(verb='Adding'),
+'X2/Y/Z/iota' : Item(verb='Adding'),
 })
 
   # Create expected status tree
@@ -3498,6 +3511,10 @@ def copy_make_parents_wc_wc(sbox):
 'X/Y' : Item(status='  ', wc_rev=2),
 'X/Y/Z'   : Item(status='  ', wc_rev=2),
 'X/Y/Z/iota'  : Item(status='  ', wc_rev=2),
+'X2'  : Item(status='  ', wc_rev=2),
+'X2/Y': Item(status='  ', wc_rev=2),
+'X2/Y/Z'  : Item(status='  ', wc_rev=2),
+'X2/Y/Z/iota' : Item(status='  ', wc_rev=2),
 })
 
   svntest.actions.run_and_verify_commit(wc_dir,
@@ -3516,11 +3533,20 @@ def copy_make_parents_repo_wc(sbox):
   iota_url = sbox.repo_url + '/iota'
   new_iota_path = sbox.ospath('X/Y/Z/iota')
 
+  # Existing unversioned dst directory case
+  new_iota_path_eudst = sbox.ospath('X2/Y/Z/iota')
+  os.makedirs(os.path.dirname(new_iota_path_eudst))
+
   # Copy iota
   svntest.actions.run_and_verify_svn(None, [],
  'cp', '--parents',
  iota_url, new_iota_path)
 
+  # Copy iota to pre-created dst directory
+  svntest.actions.run_and_verify_svn(None, [],
+ 'cp', '--parents',
+ iota_url, new_iota_path_eudst)
+
   # Create expected output
   expected_output = svntest.wc.State(wc_dir, {
 'X'   : Item(verb='Adding'),
@@ -3527,6 +3553,10 @@ def copy_make_parents_repo_wc(sbox):
 'X/Y' : Item(verb='Adding'),
 'X/Y/Z'   : Item(verb='Adding'),
 'X/Y/Z/iota'  : Item(verb='Adding'),
+'X2'  : Item(verb='Adding'),
+'X2/Y': Item(verb='Adding'),
+'X2/Y/Z'  : Item(verb='Adding'),
+'X2/Y/Z/iota' : Item(verb='Adding'),
 })
 
   # Create expected status tree
@@ -3538,6 +3568,10 @@ def copy_make_parents_repo_wc(sbox):
 'X/Y' : Item(

Re: [PATCH] fix repos-to-wc copy dst parents creation

2018-07-14 Thread Daniel Shahaf
Nikita Slyusarev wrote on Sat, Jul 14, 2018 at 13:19:54 +0300:
> Hello. This patch fixes svn copy behaviour. Let's discuss.
> What are my next steps here? Can I help somehow with patch acceptance?

The submission includes a log message and an explanation of the problem.  In
that regard it is complete and ready for review.  That will hopefully happen on
Monday.  Should you not get a response, do prod us again.

It would help to add a regression test to subversion/tests/cmdline/ or
subversion/tests/libsvn_client/.

Cheers,

Daniel

> 12.07.2018, 01:19, "Nikita Slyusarev" :
> > [[[
> > Correctly handle existing parent directories when performing repos-to-wc 
> > copy.
> >
> > * subversion/libsvn_client/copy.c
> >   (repos_to_wc_copy): If add_parents flag is set and destination parent
> >   directory exists, but is unversioned, put it under version control. 
> > Wc-to-wc
> >   copy behaves this way, and so should repos-to-wc copy do.
> > ]]]


Re: [PATCH] fix repos-to-wc copy dst parents creation

2018-07-14 Thread Nikita Slyusarev
Hello. This patch fixes svn copy behaviour. Let's discuss.
What are my next steps here? Can I help somehow with patch acceptance?

12.07.2018, 01:19, "Nikita Slyusarev" :
> [[[
> Correctly handle existing parent directories when performing repos-to-wc copy.
>
> * subversion/libsvn_client/copy.c
>   (repos_to_wc_copy): If add_parents flag is set and destination parent
>   directory exists, but is unversioned, put it under version control. Wc-to-wc
>   copy behaves this way, and so should repos-to-wc copy do.
> ]]]

-- 
Nikita Slyusarev
Yandex



[PATCH] fix repos-to-wc copy dst parents creation

2018-07-11 Thread Nikita Slyusarev
[[[
Correctly handle existing parent directories when performing repos-to-wc copy.

* subversion/libsvn_client/copy.c
  (repos_to_wc_copy): If add_parents flag is set and destination parent
  directory exists, but is unversioned, put it under version control. Wc-to-wc
  copy behaves this way, and so should repos-to-wc copy do.
]]]

-- 
Nikita SlyusarevIndex: subversion/libsvn_client/copy.c
===
--- subversion/libsvn_client/copy.c	(revision 1835673)
+++ subversion/libsvn_client/copy.c	(working copy)
@@ -2742,6 +2742,16 @@ repos_to_wc_copy(svn_boolean_t *timestamp_sleep,
   SVN_ERR(svn_client__make_local_parents(dst_parent, TRUE, ctx,
  iterpool));
 }
+  else if (make_parents && dst_parent_kind == svn_node_dir)
+{
+  SVN_ERR(svn_wc_read_kind2(&dst_parent_kind, ctx->wc_ctx, dst_parent,
+FALSE, TRUE, iterpool));
+  if (dst_parent_kind == svn_node_none)
+{
+  SVN_ERR(svn_client__make_local_parents(dst_parent, TRUE, ctx,
+ iterpool));
+}
+}
   else if (dst_parent_kind != svn_node_dir)
 {
   return svn_error_createf(SVN_ERR_WC_NOT_WORKING_COPY, NULL,