pbranch for tracking upstream

Neal Becker ndbecker2 at gmail.com
Mon Aug 16 18:41:42 UTC 2010


Mark A. Flacy wrote:

> On Mon, 2010-08-16 at 13:11 -0400, Neal Becker wrote:
>> Is there a tutorial on using pbranch for tracking upstream?
> 
> Just the stuff at http://arrenbrecht.ch/mercurial/pbranch/
> 
> Did you read http://arrenbrecht.ch/mercurial/pbranch/graph.htm and
> http://arrenbrecht.ch/mercurial/pbranch/pullupstream.htm ?
> 
>> 
>> I'm not sure if I'm doing this correctly.
>> 
>> I got my upstream, calling it boost_1_44_0.dist.
>> 
>> I cloned it to boost_1_44_0.hg.
>> 
>> Then I took each of my patchsets.  Using hgtk, I started a new pbranch
>> for
>> each patchset.  I keep editing the dependency graph, these patches are
>> independent (I think), so I edit each to depend only on default.
> 
> Does hgtk know about pnew?  Or did it use the base branch command?
> 
>> 
>> I've got this:
>> 
>> hg pgraph
>> o  BUILD
>> |
>> | o  user-config
>> |/
>> | o  mersenne
>> |/
>> | o  constrained_value
>> |/
>> | o  multi_array
>> |/
>> | o  hgignore
>> |/
>> | o  vector_traits
>> |/
>> | o  vector
>> |/
>> | @  test11
>> |/
>> o  default
>> 
>> Is this what I want?
> 
> I believe that you'd have to modify .hg/pgraph to assert that BUILD has
> a dependency on the test11, vector, vector_traits, multi_array,
> constrained_value, mersenne, and user-config branches.
> 
> There's an example in that tutorial.
> 
>> 
>> What do I do when the next upstream version is released?
> 
> I assume that you aren't getting the boost source from another hg
> repository. (If you are, then you can skip the following bit.)  I'd make
> a repository that contains the snapshots that you are obtaining.  You
> *don't* do any development in it and you *don't* push any changes into
> it.  You just put each snapshot as they come (by deleting the working
> directory, expanding the source into it, and committing the source as a
> changeset).  You pull from this repository into your working one which
> has all the pbranch goodness.
> 
> If you are getting the boost source from another hg repository, you'd
> run "hg pgraph --status" to see what's going to happen and then run "hg
> pmerge --all" to update all of your branches.
> 
> I haven't used pbranch in a while, so there may be some recent changes
> that would invalidate the above.  I had used it to create some updates
> to submit for the KPhone application a couple of years ago and haven't
> really used it since.
> 

I'm confused about patch dependency.  My patches should all be independent.  
But when I tried to set things up this way (edit pgraph so that all branches 
depended only on default), I don't think I got what I wanted.  My working 
directory then only had 1 patch, not the union of all the patches.

Do I want to just have this as a linear graph (even though in reality there 
is no actual dependency between the patches)?

If I do this, my working directory is correct (the union of all the 
patches).  I'm just not sure what happens when upstream later adopts my 
patch (or something close to it).  That was my whole objective in trying 
pbranch.  I want to be able to drop my local patch when it is later adopted 
upstream.  *** upstream will not be using hg!!! ***.  Maybe in that case 
pbranch doesn't help?





More information about the Mercurial mailing list