How do I push specific changesets to a shared library repo in Mercurial? -
i have repo called mysharedlib, , repo called myproject. mysharedlib included in many different repos force-pulling (like jedi), , not using subrepos.
if clone myproject, left following structure:
/myproject mysharedlib otherstuff files...
mysharedlib not subrepo. pulling in changes mysharedlib easy running:
hg pull -f path/to/mysharedlib.
but if changes made /myproject/mysharedlib, what's straightforward/standard way push changes mysharedlib repo?
mq? hg export? hg diff? hg transplant? understanding of these options work (some together, apart), i'd direction.
and happens if dev makes commit includes other files within mysharedlib? avoid, i'm curious.
here constraints govern can push:
- you can push whole changesets -- if commit changes it's or none on pushing front, can't break changeset after commit it
- you can't push changeset without pushing of ancestor changesets to
so once you've committed linear history this:
[0]---[1]----[2]-----[3]
you can push changesets 0 , 1 without pushing 2 , three, if want push 2 have push 0 , one.
and if changeset 1 contains changes both /myproject/otherstuff , /myproject/mysharedlib/ have push together.
your flexibility comes before commit can control:
- what goes changeset
- what parents of changeset (which have pushed it)
so if history looks this:
[0]---[1]
and hg status
showing this:
m myproject/otherstuff/file1 m myproject/otherstuff/file2 m myproject/mysharedlib/file3 m myproject/mysharedlib/file4
then want make new changeset has changes mysharedlib want push:
hg commit --include myproject/mysharedlib
making history like:
[0]----[1]-----[2]
and then, before commit changes in otherstuff don't want push hg update
change current parent
revision new changeset have parent of 1 instead of two:
hg update 1
now when do:
hg commit
your new changeset, three, have non-mysharedlib changes , parent of one, history this:
[0]-----[1]--------[2] \ --------[3]
since 2 , 3 aren't 1 another's ancestors can push either 1 without pushing other.
that said, omnifarious right: usage isn't weird, it's out , out wrong. should @ subrepo setup. achieves goals better or have described.
Comments
Post a Comment