You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Igal Sapir <is...@apache.org> on 2018/10/06 22:08:06 UTC

SVN Workflow and Backporting

I am rather new to SVN, and actually use it mostly via GIT, i.e. `git svn
rebase` and `git svn dcommit`.

What is the best way to backport specific patches from trunk to 8.5, 7.0,
etc.?  Patch utility?  SVN Merge?  GIT cherry-pick (though the git mirrors
have a separate repos which adds some complexity I think)

I'd appreciate any tips that will point me in the right direction, or if
anyone can share their workflow.

Thanks,

Igal

Re: SVN Workflow and Backporting

Posted by Rainer Jung <ra...@kippdata.de>.
Am 09.10.2018 um 06:55 schrieb Igal Sapir:
> On Mon, Oct 8, 2018 at 3:04 AM Mark Thomas <ma...@apache.org> wrote:
> 
>> On 06/10/18 23:08, Igal Sapir wrote:
>>> I am rather new to SVN, and actually use it mostly via GIT, i.e. `git svn
>>> rebase` and `git svn dcommit`.
>>>
>>> What is the best way to backport specific patches from trunk to 8.5, 7.0,
>>> etc.?  Patch utility?  SVN Merge?  GIT cherry-pick (though the git
>> mirrors
>>> have a separate repos which adds some complexity I think)
>>>
>>> I'd appreciate any tips that will point me in the right direction, or if
>>> anyone can share their workflow.
>>
>> I use svn for backports. I use the following scripts. The first to merge
>> from trunk to 8.5.x, the second to merge from 8.5.x to 7.0.x. I `cd`
>> into the root of the repo for the version I want to merge to and then
>> call the script with the revision of the commit I want to back-port.
>>
>> HTH,
>>
>> Mark
>>
>> mark@study04:~/bin$ cat tc-merge.sh
>> #!/bin/sh
>> svn up
>> svn merge -c $1 https://svn.apache.org/repos/asf/tomcat/trunk
>>
>> mark@study04:~/bin$ cat tc85-merge.sh
>> #!/bin/sh
>> svn up
>> svn merge -c $1 https://svn.apache.org/repos/asf/tomcat/tc8.5.x/trunk
>>
>>
> It helps, thanks, but I don't know if the target file has been changed or
> if I did something wrong, I'm getting a conflict (in git I can see the
> differences and choose resolution, but here I don't know which one to
> pick).  Or is it because I waited too long and didn't do this immediately
> after committing the original patch to trunk?
> 
> Here's the output from the script:
> 
>   tc8.5.x]$ ~/bin/svn-merge-tc-trunk-to-85.sh 1842849
> Updating '.':
> At revision 1843219.
> --- Merging r1842849 into '.':
>     C test
>     C java
> --- Recording mergeinfo for merge of r1842849 into '.':
>   U   .
> Summary of conflicts:
>    Tree conflicts: 2
> Searching tree conflict details for 'java' in repository:
> Checking r1842849... done
> Tree conflict on 'java':
> Changes destined for a directory arrived during merge of
> '^/tomcat/trunk/java:1842849'.
> No such file or directory was found in the merge target working copy.
> The item may have been deleted or moved away in the repository's history.
> 
> Subversion is not smart enough to resolve this tree conflict automatically!
> 
> Apparently neither am I :s

Not sure, but from the prompt it looks like your shell working directory 
is a 8.5 checkout and your are using the script that contains the 
command to merge from 8.5 to some older branch.

When standiung in 8.5 you want to merge from trunk (9.0) into 8.5. That 
would be done by the tc-merge.sh script. You might now need to first 
reset your checkout using something like "svn -R revert ." before try 
running that script.

Regards,

Rainer

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: SVN Workflow and Backporting

Posted by Igal Sapir <ig...@lucee.org>.
On Tue, Oct 9, 2018 at 2:31 AM Mark Thomas <ma...@apache.org> wrote:

> On 09/10/18 05:55, Igal Sapir wrote:
> > On Mon, Oct 8, 2018 at 3:04 AM Mark Thomas <ma...@apache.org> wrote:
> >
> >> On 06/10/18 23:08, Igal Sapir wrote:
> >>> I am rather new to SVN, and actually use it mostly via GIT, i.e. `git
> svn
> >>> rebase` and `git svn dcommit`.
> >>>
> >>> What is the best way to backport specific patches from trunk to 8.5,
> 7.0,
> >>> etc.?  Patch utility?  SVN Merge?  GIT cherry-pick (though the git
> >> mirrors
> >>> have a separate repos which adds some complexity I think)
> >>>
> >>> I'd appreciate any tips that will point me in the right direction, or
> if
> >>> anyone can share their workflow.
> >>
> >> I use svn for backports. I use the following scripts. The first to merge
> >> from trunk to 8.5.x, the second to merge from 8.5.x to 7.0.x. I `cd`
> >> into the root of the repo for the version I want to merge to and then
> >> call the script with the revision of the commit I want to back-port.
> >>
> >> HTH,
> >>
> >> Mark
> >>
> >> mark@study04:~/bin$ cat tc-merge.sh
> >> #!/bin/sh
> >> svn up
> >> svn merge -c $1 https://svn.apache.org/repos/asf/tomcat/trunk
> >>
> >> mark@study04:~/bin$ cat tc85-merge.sh
> >> #!/bin/sh
> >> svn up
> >> svn merge -c $1 https://svn.apache.org/repos/asf/tomcat/tc8.5.x/trunk
> >>
> >>
> > It helps, thanks, but I don't know if the target file has been changed or
> > if I did something wrong, I'm getting a conflict (in git I can see the
> > differences and choose resolution, but here I don't know which one to
> > pick).  Or is it because I waited too long and didn't do this immediately
> > after committing the original patch to trunk?
> >
> > Here's the output from the script:
> >
> >  tc8.5.x]$ ~/bin/svn-merge-tc-trunk-to-85.sh 1842849
> > Updating '.':
> > At revision 1843219.
> > --- Merging r1842849 into '.':
> >    C test
> >    C java
> > --- Recording mergeinfo for merge of r1842849 into '.':
> >  U   .
> > Summary of conflicts:
> >   Tree conflicts: 2
> > Searching tree conflict details for 'java' in repository:
> > Checking r1842849... done
> > Tree conflict on 'java':
> > Changes destined for a directory arrived during merge of
> > '^/tomcat/trunk/java:1842849'.
> > No such file or directory was found in the merge target working copy.
> > The item may have been deleted or moved away in the repository's history.
> >
> > Subversion is not smart enough to resolve this tree conflict
> automatically!
> >
> > Apparently neither am I :s
>
> That looks like you aren't in the right place in the 8.5.x source tree
> to apply the patch.
>
> Using my scripts I need to be in tc8.5.x/trunk when apply a patch from
> trunk to 8.5.x. Essentially, the path in the merge command and the cwd
> have to 'line up'.
>

Ha!  That seems to have worked smoothly from the trunk directory.

Thank you,

Igal

Re: SVN Workflow and Backporting

Posted by Mark Thomas <ma...@apache.org>.
On 09/10/18 05:55, Igal Sapir wrote:
> On Mon, Oct 8, 2018 at 3:04 AM Mark Thomas <ma...@apache.org> wrote:
> 
>> On 06/10/18 23:08, Igal Sapir wrote:
>>> I am rather new to SVN, and actually use it mostly via GIT, i.e. `git svn
>>> rebase` and `git svn dcommit`.
>>>
>>> What is the best way to backport specific patches from trunk to 8.5, 7.0,
>>> etc.?  Patch utility?  SVN Merge?  GIT cherry-pick (though the git
>> mirrors
>>> have a separate repos which adds some complexity I think)
>>>
>>> I'd appreciate any tips that will point me in the right direction, or if
>>> anyone can share their workflow.
>>
>> I use svn for backports. I use the following scripts. The first to merge
>> from trunk to 8.5.x, the second to merge from 8.5.x to 7.0.x. I `cd`
>> into the root of the repo for the version I want to merge to and then
>> call the script with the revision of the commit I want to back-port.
>>
>> HTH,
>>
>> Mark
>>
>> mark@study04:~/bin$ cat tc-merge.sh
>> #!/bin/sh
>> svn up
>> svn merge -c $1 https://svn.apache.org/repos/asf/tomcat/trunk
>>
>> mark@study04:~/bin$ cat tc85-merge.sh
>> #!/bin/sh
>> svn up
>> svn merge -c $1 https://svn.apache.org/repos/asf/tomcat/tc8.5.x/trunk
>>
>>
> It helps, thanks, but I don't know if the target file has been changed or
> if I did something wrong, I'm getting a conflict (in git I can see the
> differences and choose resolution, but here I don't know which one to
> pick).  Or is it because I waited too long and didn't do this immediately
> after committing the original patch to trunk?
> 
> Here's the output from the script:
> 
>  tc8.5.x]$ ~/bin/svn-merge-tc-trunk-to-85.sh 1842849
> Updating '.':
> At revision 1843219.
> --- Merging r1842849 into '.':
>    C test
>    C java
> --- Recording mergeinfo for merge of r1842849 into '.':
>  U   .
> Summary of conflicts:
>   Tree conflicts: 2
> Searching tree conflict details for 'java' in repository:
> Checking r1842849... done
> Tree conflict on 'java':
> Changes destined for a directory arrived during merge of
> '^/tomcat/trunk/java:1842849'.
> No such file or directory was found in the merge target working copy.
> The item may have been deleted or moved away in the repository's history.
> 
> Subversion is not smart enough to resolve this tree conflict automatically!
> 
> Apparently neither am I :s

That looks like you aren't in the right place in the 8.5.x source tree
to apply the patch.

Using my scripts I need to be in tc8.5.x/trunk when apply a patch from
trunk to 8.5.x. Essentially, the path in the merge command and the cwd
have to 'line up'.

HTH,

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: SVN Workflow and Backporting

Posted by Igal Sapir <ig...@lucee.org>.
On Mon, Oct 8, 2018 at 3:04 AM Mark Thomas <ma...@apache.org> wrote:

> On 06/10/18 23:08, Igal Sapir wrote:
> > I am rather new to SVN, and actually use it mostly via GIT, i.e. `git svn
> > rebase` and `git svn dcommit`.
> >
> > What is the best way to backport specific patches from trunk to 8.5, 7.0,
> > etc.?  Patch utility?  SVN Merge?  GIT cherry-pick (though the git
> mirrors
> > have a separate repos which adds some complexity I think)
> >
> > I'd appreciate any tips that will point me in the right direction, or if
> > anyone can share their workflow.
>
> I use svn for backports. I use the following scripts. The first to merge
> from trunk to 8.5.x, the second to merge from 8.5.x to 7.0.x. I `cd`
> into the root of the repo for the version I want to merge to and then
> call the script with the revision of the commit I want to back-port.
>
> HTH,
>
> Mark
>
> mark@study04:~/bin$ cat tc-merge.sh
> #!/bin/sh
> svn up
> svn merge -c $1 https://svn.apache.org/repos/asf/tomcat/trunk
>
> mark@study04:~/bin$ cat tc85-merge.sh
> #!/bin/sh
> svn up
> svn merge -c $1 https://svn.apache.org/repos/asf/tomcat/tc8.5.x/trunk
>
>
It helps, thanks, but I don't know if the target file has been changed or
if I did something wrong, I'm getting a conflict (in git I can see the
differences and choose resolution, but here I don't know which one to
pick).  Or is it because I waited too long and didn't do this immediately
after committing the original patch to trunk?

Here's the output from the script:

 tc8.5.x]$ ~/bin/svn-merge-tc-trunk-to-85.sh 1842849
Updating '.':
At revision 1843219.
--- Merging r1842849 into '.':
   C test
   C java
--- Recording mergeinfo for merge of r1842849 into '.':
 U   .
Summary of conflicts:
  Tree conflicts: 2
Searching tree conflict details for 'java' in repository:
Checking r1842849... done
Tree conflict on 'java':
Changes destined for a directory arrived during merge of
'^/tomcat/trunk/java:1842849'.
No such file or directory was found in the merge target working copy.
The item may have been deleted or moved away in the repository's history.

Subversion is not smart enough to resolve this tree conflict automatically!

Apparently neither am I :s

Re: SVN Workflow and Backporting

Posted by Mark Thomas <ma...@apache.org>.
On 06/10/18 23:08, Igal Sapir wrote:
> I am rather new to SVN, and actually use it mostly via GIT, i.e. `git svn
> rebase` and `git svn dcommit`.
> 
> What is the best way to backport specific patches from trunk to 8.5, 7.0,
> etc.?  Patch utility?  SVN Merge?  GIT cherry-pick (though the git mirrors
> have a separate repos which adds some complexity I think)
> 
> I'd appreciate any tips that will point me in the right direction, or if
> anyone can share their workflow.

I use svn for backports. I use the following scripts. The first to merge
from trunk to 8.5.x, the second to merge from 8.5.x to 7.0.x. I `cd`
into the root of the repo for the version I want to merge to and then
call the script with the revision of the commit I want to back-port.

HTH,

Mark



mark@study04:~/bin$ cat tc-merge.sh
#!/bin/sh
svn up
svn merge -c $1 https://svn.apache.org/repos/asf/tomcat/trunk

mark@study04:~/bin$ cat tc85-merge.sh
#!/bin/sh
svn up
svn merge -c $1 https://svn.apache.org/repos/asf/tomcat/tc8.5.x/trunk

> 
> Thanks,
> 
> Igal
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org