Behavior Difference Between unbundle and import --exact
Matt Mackall
mpm at selenic.com
Mon Jul 14 12:11:17 CDT 2008
On Mon, 2008-07-14 at 10:56 -0500, Kevin Christen wrote:
> I'm trying to test a workflow for a team who's members can't all pull
> from the "gold copy" repository (don't ask...). I've tried two
> different approachs: sending the gold copy updates out as bundles, and
> sending them out as patches to be imported with the --exact option.
> The bundle approach works fine, but the import approach fails when
> importing a merge changeset with this message:
>
> abort: cannot partially commit a merge (do not specify files or
> patterns)
>
> The attached script demonstrates: run it as-is to see the failure, and
> comment out line 2 ("export=1") to run it successfully using
> bundle/unbundle.
>
> I have two questions: what does the error message mean, and am I wrong
> to expect that bundle/unbundle and export/import --exact work
> similarly?
That's a big scary script, and I'm afraid to run it. Can you simplify it
a bit? Here's a minimal test script that works for me:
#!/bin/sh
rm -rf a b
hg init a
cd a
echo a > a
hg ci -Aqm0
echo b > b
hg ci -Aqm1
hg clone -q . ../b
hg co -q 0
echo c > c
hg ci -Aqm2
hg merge -q
hg ci -m3
hg id
hg export 2 > 2
hg export 3 > 3
cd ../b
hg import --exact ../a/2
hg import --exact ../a/3
hg id
As for your question: no, you actually can't expect import --exact to
always work. There are various small details like whether the changelog
ends in a newline that can foul things up.
--
Mathematics is the supreme nostalgia of our time.
More information about the Mercurial
mailing list