Individual file merge . Merging a newly added file

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Individual file merge . Merging a newly added file

JP-2
Dear All,


I am trying to merge a newly added file  . I am getting the following error .

svn merge -c123 https://my.svn.domain/svn/foo/branches/bar/newfile.txt ./newfile.txt
svn: E200009: Merge target './newfile.txt' does not exist in the working copy


https://my.svn.domain/svn/foo/branches/bar/newfile.txt is in status "A" .  How can I do such merges .


JP

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Individual file merge . Merging a newly added file

Lorenz-2
JP wrote:
>I am trying to merge a newly added file  . I am getting the following
>error .
>
>|svn merge -c123 https://my.svn.domain/svn/foo/branches/bar/newfile.txt ./newfile.txt
>svn: E200009: Merge target './newfile.txt' does not exist in the working copy
>
>https://my.svn.domain/svn/foo/branches/bar/newfile.txt is in status "A"
>.  How can I do such merges .


adding a file is a change to the parent directory.
--

Lorenz

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Individual file merge . Merging a newly added file

Andrew Reedick-2


> -----Original Message-----
> From: Lorenz [mailto:[hidden email]]
> Sent: Wednesday, August 2, 2017 1:34 AM
> To: [hidden email]
> Subject: Re: Individual file merge . Merging a newly added file
>
> JP wrote:
> >I am trying to merge a newly added file  . I am getting the following
> >error .
> >
> >|svn merge -c123
> >|https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmy.sv
> >|n.domain%2Fsvn%2Ffoo%2Fbranches%2Fbar%2Fnewfile.txt&data=02%7C01%7Cjre
> >|edick%40incomm.com%7Cbf08bacf2e7f48e9062108d4d9683be1%7Cd08e5403b1c94d
> >|bfaf91bab966a84dea%7C1%7C0%7C636372489093013309&sdata=%2BS0P8L4moTaajr
> >|L5XQS%2BIc4ln8hyEci1GdDKhYkh1eE%3D&reserved=0 ./newfile.txt
> >svn: E200009: Merge target './newfile.txt' does not exist in the
> >working copy
> >
> >https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmy.svn.domain%2Fsvn%2Ffoo%2Fbranches%2Fbar%2Fnewfile.txt&data=02%7C01%7Cjreedick%40incomm.com%7Cbf08bacf2e7f48e9062108d4d9683be1%7Cd08e5403b1c94dbfaf91bab966a84dea%7C1%7C0%7C636372489093013309&sdata=%2BS0P8L4moTaajrL5XQS%2BIc4ln8hyEci1GdDKhYkh1eE%3D&reserved=0 is in status "A"
> >.  How can I do such merges .
>
>
> adding a file is a change to the parent directory.

Translation:  The newly added newfile.txt is completely unrelated to the previously existing newfile.txt you are merging from.

Either
a) Remove the newly added newfile.txt and instead do a 'svn copy ...' of the previously existing newfile.txt to the new location.  This preserves ancestry and makes merging easier.
Or
b) If the newly added newfile.txt really should be completely independent/unrelated to the previously existing newfile.txt, then you will need to use a "2-URL merge" to merge the previously existing newfile.txt into the newly added newfile.txt.  Refer to "svn help merge".


From "svn help merge":
  3. This form is called a '2-URL merge':
...
The target branch may be the same as one or both sources, or different again.
     The three branches involved can be completely unrelated.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Individual file merge . Merging a newly added file

Lorenz-2
Andrew Reedick wrote:

>> -----Original Message-----
>> From: Lorenz [mailto:[hidden email]]
>> Sent: Wednesday, August 2, 2017 1:34 AM
>> To: [hidden email]
>> Subject: Re: Individual file merge . Merging a newly added file
>>
>> JP wrote:
>> >
>>>I am trying to merge a newly added file  . I am getting the following
>>>error .
>>>
>>>|svn merge -c123 https://my.svn.domain/svn/foo/branches/bar/newfile.txt ./newfile.txt
>>>svn: E200009: Merge target './newfile.txt' does not exist in the working copy
>>>
>>>https://my.svn.domain/svn/foo/branches/bar/newfile.txt is in status "A"
>>>.  How can I do such merges .
>>
>> adding a file is a change to the parent directory.
>
>Translation:  The newly added newfile.txt is completely unrelated to the previously existing newfile.txt you are merging from.
>
>Either
>a) Remove the newly added newfile.txt and instead do a 'svn copy ...' of the previously existing newfile.txt to the new location.  This preserves ancestry and makes merging easier.
>Or
>b) If the newly added newfile.txt really should be completely independent/unrelated to the previously existing newfile.txt, then you will need to use a "2-URL merge" to merge the previously existing newfile.txt into the newly added newfile.txt.  Refer to "svn help merge".
>
>
>From "svn help merge":
>  3. This form is called a '2-URL merge':
>...
>The target branch may be the same as one or both sources, or different again.
>     The three branches involved can be completely unrelated.

that's not the OPs scenario (I think)

OP added a file on a branch and then wants to cherry-pick-merge the
addition to trunk (or a different branch).

But you can only merge changes of a file to a already existing target.

That is he needs to merge the addition of the file on the parent
folder level.
--

Lorenz

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Individual file merge . Merging a newly added file

Daniel Shahaf-2
In reply to this post by Andrew Reedick-2
Andrew Reedick wrote on Wed, 02 Aug 2017 12:32 +0000:
> Translation:  The newly added newfile.txt is completely unrelated to the previously existing newfile.txt you are merging from.

JP, note that Andrew was assuming here that the status is really
just "A".  If the status is "A +" then Andrew's reply might or might
not apply.

(To the list: it's possible JP did a 'merge -c 122' which created the
file and now is trying 'merge -c 123' to cherry-pick a followup commit
to that file.)
Loading...