“hg archive” command description

Bob Hood bhood2 at comcast.net
Mon Feb 24 16:26:18 UTC 2014


On 2/24/2014 8:36 AM, Pietro Moras wrote:
> Fine Bob,
>    I begin to see.
> Now, what's the use & purpose of option "--prefix"?
> Thanks for your answer.

The command name, "archive", actually indicates that the working copy will be
converted into an archive.  This is defined by the command as a single file
that is in a supported "archive" format (e.g., "zip").  It will also just
copy, file-for-file, each entry in the working copy to the destination
location, making a copy of the working folder itself.  This is the default
behavior.

If you indicate an actual "archive" format, then you have the option to change
the prefix for the files that are stored in the archive.  So, for example, say
I create a Zip archive of a local working copy on my Windows machine:

   hg archive %TMP%\workingcopy.zip

Then Mercurial will create a Zip archive where the files in the working folder
will be contained in a single top folder called "workingcopy/".  You can use
the "--prefix" command to change the actual containing folder.  So, this command:

   hg archive --prefix bob %TMP%\workingcopy.zip

Would make an archive where working folder files are contained in a "bob/"
folder instead.

I hope that makes things clearer.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20140224/e9acd24d/attachment-0002.html>


More information about the Mercurial mailing list