"hg import" can't handle multiple changesets per file
TK Soh
teekaysoh at yahoo.com
Wed Aug 24 22:02:39 CDT 2005
--- Matt Mackall <mpm at selenic.com> wrote:
> On Wed, Aug 24, 2005 at 07:09:21PM -0700, Josh Triplett wrote:
> > [Please CC me on replies, as I am not subscribed to the list.]
> >
> > If you do "hg export 1 2 3 > file.patch", file.patch will contain a set
> > of hg changesets in exported form, including the hg header comment
> > before each. However, "hg import file.patch" will ignore all but the
> > first header, and treat the entire file as a representation of that one
> > changeset. In my case, this caused three large changesets to be
> > committed as one changeset, amusingly titled "formatting fixes". :)
>
> There isn't really a clean way to fix this. But you probably wanted:
>
> hg export -o "file-%n.patch" 1 2 3
> hg import file-*.patch
Or in case the changesets have been exported all to one file. You can use the
csplit utility to split the changesets into files (xx*), then pass the files to
import.
$ csplit patches '/^# HG changeset patch/' "{*}"
$ cd repo
$ hg import ../xx*
____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs
More information about the Mercurial
mailing list