Using bzr to update a series for patches
Ben Finney
ben+bazaar at benfinney.id.au
Fri Apr 30 06:44:41 BST 2010
Chris Packham <judge.packham at gmail.com> writes:
> In git I'd do something like this
>
> git clone <upstream>
> git checkout <tag that corresponds to the version of the tarball we use>
> git checkout -b our-patches
> git am <patches>
> git rebase <tag that corresponds to the new version we want to use>
> # fix merge issues with 'git merge-tool' or similar
> git format-patch ...
I don't quite know Git as well as might be needed to understand the
above, but I would fill in some blanks.
Begin a new repository where local development is branched from
upstream::
$ mkdir foo-project/
$ cd foo-project/
$ git clone $upstream_repo/ foo.upstream/
$ git clone foo.upstream/ foo.devel/
$ cd foo.devel/
$ git checkout -b upstream # to identify this point for later reference
I'm not sure how Git would identify each of the bundles that were to
become discrete patches grouped together, if you're not somehow tagging
or branching or whatever to indicate which revision belongs to which
branch. So I'll show what I understand to be the next steps.
Apply each distinct set of local changes to a separate named branch::
$ git checkout -b bug-fix-246
$ git apply ../bug-fix-246.diff
$ git commit --message "New bug fix for #246."
$ git rebase
$ git checkout -b bug-fix-369
$ git apply ../bug-fix-369.diff
$ git commit --message "Use Jeff's bug fix for #369."
$ git rebase
$ git format-patch ../patches/
Update patches in response to new upstream version::
$ git checkout upstream
$ git pull
$ git checkout bug-fix-246
$ git rebase
$ git merge-tool # fix conflicts manually
$ git checkout bug-fix-369
$ git rebase
$ git merge-tool # fix conflicts manually
$ git format-patch ../patches/
> Has anybody got a similar recipe for bzr?
I have had success recently using the ‘pipeline’ feature, from the
‘bzr-pipeline’ plug-in. (‘aptitude install bzr-pipeline’ if you're on
Debian Squeeze or later.)
Your above workflow would then be:
Begin a new repository where local development is branched from
upstream::
$ mkdir foo-project/
$ cd foo-project/
$ bzr branch $upstream_branch/ foo.upstream/
$ bzr branch foo.upstream/ foo.devel/
$ cd foo.devel/
$ bzr reconfigure-pipeline
Apply each distinct set of local changes to a separate named branch::
$ bzr add-pipe bug-fix-246
$ bzr patch ../bug-fix-246.diff
$ bzr commit --message "New bug fix for #246."
$ bzr add-pipe bug-fix-369
$ bzr patch ../bug-fix-369.diff
$ bzr commit --message "Use Jeff's bug fix for #369."
$ bzr pipe-patches ../patches/
Update patches in response to new upstream version::
$ bzr switch :pipe:foo.devel
$ bzr merge
$ bzr pump
$ bzr pipe-patches ../patches/
--
\ “I believe our future depends powerfully on how well we |
`\ understand this cosmos, in which we float like a mote of dust |
_o__) in the morning sky.” —Carl Sagan, _Cosmos_, 1980 |
Ben Finney
More information about the bazaar
mailing list