> On Fri, Sep 16, 2016 at 11:01 AM, Uwe Brauer <o...@mat.ucm.es> wrote:

   > If you look at mypatch.patch here, you'll see that it actually
   > contains multiple patches, one for each revision that you specified.
   > If you look at the help for "hg export", you'll see that the "-o"
   > option is meant to specify a *format string*, such as
   > "mypatch.patch.%n".


   > "hg import" expects the file to only contain a single patch. I don't
   > know the patch format well enought to know if it is possible to detect
   > that the file contains multiple patches, but for the moment at least,
   > "hg import" has tried to apply what is effectively a single corrupt
   > patch.

   > If you use the suggested format string for "hg export", you will get 5
   > patch files which you can import individually.

Thanks a lot, but I beg to differ.

I did run a test.


In dir orgin I run create-repo-orgin.sh which creates a repo with 5
commit containing one branch

I run hg export -r 1::3 -o mybranch.patch

In dir target I run create-repo-target.sh
which create a similar repo but without that branch



 and then

 hg import mybranch.patch

And everything works as expected.

So the patch I mentioned must be somehow corrupt.....



 hg init
 echo default1 > test.txt
 hg add test.txt
 hg commit -m "default1"
 hg branch pretty
 echo pretty1 > pretty.txt
 hg add pretty.txt
 hg commit -m "pretty1"
 echo pretty-three >> pretty.txt
 hg commit -m "Pretty three"
 echo pretty-four >> pretty.txt
 hg commit -m "Pretty four"
 hg update default
 echo default2 > test.txt
 hg commit -m "default2"
 echo default3 > test.txt
 hg commit -m "default3"
 hg log -G
# HG changeset patch
# User Uwe Brauer <o...@mat.ucm.es>
# Date 1474030127 0
#      Fri Sep 16 12:48:47 2016 +0000
# Branch pretty
# Node ID 0a491dfa3299adf8f88610178c7bcaf38e95d386
# Parent  19dee4dc2073a402d19a4d65180d53ae3810068d
pretty1

diff -r 19dee4dc2073 -r 0a491dfa3299 pretty.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pretty.txt	Fri Sep 16 12:48:47 2016 +0000
@@ -0,0 +1,1 @@
+pretty1
# HG changeset patch
# User Uwe Brauer <o...@mat.ucm.es>
# Date 1474030127 0
#      Fri Sep 16 12:48:47 2016 +0000
# Branch pretty
# Node ID 851115318f74d8818789ffc2da4c0f0e038550d9
# Parent  0a491dfa3299adf8f88610178c7bcaf38e95d386
Pretty three

diff -r 0a491dfa3299 -r 851115318f74 pretty.txt
--- a/pretty.txt	Fri Sep 16 12:48:47 2016 +0000
+++ b/pretty.txt	Fri Sep 16 12:48:47 2016 +0000
@@ -1,1 +1,2 @@
 pretty1
+pretty-three
# HG changeset patch
# User Uwe Brauer <o...@mat.ucm.es>
# Date 1474030127 0
#      Fri Sep 16 12:48:47 2016 +0000
# Branch pretty
# Node ID 33e8fbe8c3e44d2c8bca6d2d32809312fd47ed72
# Parent  851115318f74d8818789ffc2da4c0f0e038550d9
Pretty four

diff -r 851115318f74 -r 33e8fbe8c3e4 pretty.txt
--- a/pretty.txt	Fri Sep 16 12:48:47 2016 +0000
+++ b/pretty.txt	Fri Sep 16 12:48:47 2016 +0000
@@ -1,2 +1,3 @@
 pretty1
 pretty-three
+pretty-four
 hg init
 echo default1 > test.txt
 hg add test.txt
 hg commit -m "default1"
 echo default2 > test.txt
 hg commit -m "default2"
 echo default3 > test.txt
 hg commit -m "default3"
 hg log -G
_______________________________________________
Mercurial mailing list
Mercurial@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial

Reply via email to