Partial Archive

Nick Peeples nick.peeples at gmail.com
Thu Jan 3 10:49:50 CST 2008


On Jan 2, 2008 12:32 PM, Matt Mackall <mpm at selenic.com> wrote:
>
> On Wed, 2008-01-02 at 11:55 -0600, Nick Peeples wrote:
> > Ok, here is what I have come up with for anyone else looking for the same thing:
> >
> > Assuming rev is calculated from last-build + 1
> >
> > hg export -a 55: > build.patch
> >
> > Move build.patch to production folders and using
> > http://gnuwin32.sourceforge.net/packages/patch.htm (thanks Mark)
> >
> > patch -i build.patch -p 1 --binary
> >
> > This seems to handle just about everything, deletions, binary changes,
> > etc. Anything seem wrong with this?
>
> It won't handle:
>
> - permissions
> - symlinks
> - empty files getting deleted and vice-versa
> - various sorts of binaries
> - possible brain damage involving newlines
>

It's a website managed on a windows server, so I don't care about
permissions (it's a build, shouldn't installers or builders worry
about permissions anyway?) and symlinks are unimportant. The method
above did handle different picture files that were in there, and
successfully created and deleted many files (patch will clean up the
empty folders). Which binaries would be in trouble?

I don't understand the damage involving newlines. If this was going
down the path of the CR+LF, patch ignores this if you instruct that
the patch file is binary, and by adding the -a tag to export, I was
getting a binary patch file.

> Also, you probably want to use hg diff instead.
>
> > P.S. - when I was going through this, I assumed that
> >
> > hg export -o file.patch rev:tip
> >
> > would generate the same results as
> >
> > hg export rev:tip > file.patch
>
> We reopen the specified file each time. This allows us to do:
>
>  hg export -o %n.patch rev:tip
>
> ..and get a bunch of different files.
>
> --
>
> Mathematics is the supreme nostalgia of our time.
>
>

All in all I'm looking for the best way to handle websites with
Mercurial, and being able to easily update production files without
having to transfer entire archives around. This is the path that I
have veered down, but is by no means set in stone.

-Nick


More information about the Mercurial mailing list