hg import --patch for hg import

Arne Babenhauserheide arne_bab at web.de
Tue Nov 11 18:28:49 UTC 2008


Hi, 

it would be nice if 

$ hg import --patch

would return a patch which could be imported via hg import directly (with the 
same information as hg export). 

Also it would be nice if a patch generated with hg export from several 
revision would again be imported as several distinct revisions (it contains 
the changeset information of every exported revision, so I think they should 
be used by import). 

example: 

------- ------ ------ 
hg init repo1
cd repo1

echo "blah" > blah
hg add blah
hg ci -m "blah"

echo "foo" > blah
hg ci -m "foo"

hg export 0: > patch

cd ..
hg init repo2
cd repo2

hg import ../repo1/patch
------- ------ ------ 

Now repo2 should contain rev0 and rev1 from repo1. 

(hg export 1: returns all revision higher or equal to 1)

But instead it adds one single changeset with the whole patch and the 
changeset information from only rev0. 
and 
$ hg import --exact ../repo1/patch 
throws an error 
--- --- --- --- --- --- 
applying ../repo1/patch
rolling back last transaction
abort: patch is damaged or loses information
--- --- --- --- --- --- 

this should just import several revisions. 


Also it would be nice if 

$ hg pull --patch

would give a patch as if hg export was evoked, so it could be imported 
directly without losing information. 

This would allow to easily transfer changes into a feature branch which 
someone else put into the default branch in the remote repository. 

Best wishes, 
Arne
-- 
-- My stuff: http://draketo.de - stories, songs, poems, programs and stuff :)
-- Infinite Hands: http://infinite-hands.draketo.de - singing a part of the 
history of free software.
-- Ein Würfel System: http://1w6.org - einfach saubere (Rollenspiel-) Regeln.

-- PGP/GnuPG: http://draketo.de/inhalt/ich/pubkey.txt




More information about the Mercurial mailing list