does this workflow sound like a good idea?
Jorge Vargas
jorge.vargas at gmail.com
Tue Oct 7 22:34:40 UTC 2008
On Tue, Oct 7, 2008 at 1:33 PM, Patrick Waugh <ptwaugh at gmail.com> wrote:
> Ok, I'm finally about to "really" use Hg (cheers)!
>
> I am setting up Zen-Cart, and here is what I'm planning to do, and I
> thought I'd ask for views on this from those more experienced.
>
> To begin, I unzipped the current version, 1.3.8a and created a repository:
>
> hg init
> hg add
> hg ci -m "Initial commit"
> hg tag 1.3.8a
>
> and now I'm going to add the Google-Checkout mod. Now as there are no
> other mods yet, installation is trivial, and I could just overwrite
> existing files, and then do another commit.
>
> However, what I'm thinking I might want to do is create a "patch".
> Why? Well, because typically when this mod is updated, it must be
> completely removed and the new version then installed. So, this seems
> to be the way to go.
>
> Now, if I imagine that I want to install another mod "cool_stuff",
> after having already installed another mod, I could create a branch
> with the original version as a parent, so I can do a trivial install,
> and then merge the two resulting branches.
>
> Does this sound like it makes sense? Other thoughts?
first of it's not a good idea to checkin thirdparty code into your
repo, that is what packages and installation is for.
Now if you are modifying the source (that is as opposed to just using
it by imports) then It may be a good idea, to check in the source.
Now your patches approach is a good one, it's such a good idea some
one wrote a whitepaper on it then a tool and then it was incorporated
into mercurial, it's call "patch queues" in mercurial it's handled by
the mq extension, and it's awesome.
Here are some links to get you started. (the first one is particularly good)
http://www.selenic.com/mercurial/wiki/index.cgi/MqTutorial
http://www.selenic.com/mercurial/wiki/index.cgi/MqExtension
http://hgbook.red-bean.com/hgbookch12.html
so basically you will do something like this.
hg init
hg add
hg ci -m "Initial commit"
hg tag 1.3.8a
hg qinit (maybe -c depends on what exactly your doing)
hg qnew google-checkout
apply that
hg qrefresh
hg qnew my-hacks
vi some hacking
hg qrefresh
now when a new version of google checkout comes out you will do:
hg qpop -a
<update the base zen-cart code>
hg qpush (will apply the google-checkout patch - things will probably break.)
<update the google-checkout code>
hg qpush (will apply the google-checkout patch - things will probably break.)
note that the above break is managed by patch logistics so you are
basically mergging stuff.
More information about the Mercurial
mailing list