Pulling out directory
Eric Siegerman
pub08-hg at davor.org
Tue Jan 22 02:52:08 UTC 2013
You can get the directory's history into the new repo -- something along
the lines of:
1) use "hg convert" to split the directory out into its own little
repo -- but put it, within that little repo, *not* at the root, but
rather at the relative pathname you want it to end up in in the final repo
2) use "hg pull --force" to get the little repo that you created at
step #1 into the final repo
3) at this point, the final repo has two completely unrelated DAGs in
it; use "hg merge" to tie them together
You'll get a history something like this (left column is the stuff that
was already in the new repo; right column is the directory you've just
pulled in and merged):
o
|\
| \
| \
| o
| |
| o
| |
| o
|
o
|
o
|
o
What I don't know is how to coalesce the two histories back together as
though they'd never been split up in the first place. You could get a
crude approximation, though (with a fair bit of manual effort) using
http://wiki.monotone.ca/ZipperMerge/ .
- Eric
On 01/21/2013 09:17 PM, Adrian Klaver wrote:
> On 01/20/2013 05:37 PM, Adrian Klaver wrote:
>> Wonder if it is possible to pull a directory out of one repo and put it
>> into another along with its history?
>>
>> The situation is:
>>
>> 1) Converted a bzr directory to hg.
>> 2) Realized it was good time to split the project.
>> 3) Use hg convert the hg repo created into two smaller hg repos leaving
>> out some directories that I thought where not necessary.
>> 4) Then realized one of those left out directories really needed to be
>> moved into one of the new repos.
>> 5) Would like to do so and keep the history for the code in that
>> directory.
>>
>
> So I guess not?
>
More information about the Mercurial
mailing list