我对SVN相当满意,但一直在研究Mercurial,因为它具有执行脱机提交的功能。我无法弄清楚的是如何对未标记的旧版本进行无版本导出。在SVN中,标签仅位于存储库中的\tags文件夹中,然后我可以从那里导出某些内容,但似乎与Hg项目使用的不是相同的trunk-branches-tags目录(或者它们是吗? )

我能弄清楚的最好的办法就是克隆存储库,然后删除.hg文件夹。 TortoiseHg也不显示标签列表,因此我克隆,浏览日志,更新为任意内容,然后删除/.hg。这似乎很笨拙,是否有一些首选方法?

最佳答案

使用“hg存档”。

  hg archive [OPTION]... DEST

  create an unversioned archive of a repository revision

    By default, the revision used is the parent of the working
    directory; use -r/--rev to specify a different revision.

    To specify the type of archive to create, use -t/--type. Valid
    types are:

    "files" (default): a directory full of files
    "tar": tar archive, uncompressed
    "tbz2": tar archive, compressed using bzip2
    "tgz": tar archive, compressed using gzip
    "uzip": zip archive, uncompressed
    "zip": zip archive, compressed using deflate

    The exact name of the destination archive or directory is given
    using a format string; see 'hg help export' for details.

    Each member added to an archive file has a directory prefix
    prepended. Use -p/--prefix to specify a format string for the
    prefix. The default is the basename of the archive, with suffixes
    removed.

  options:

    --no-decode  do not pass files through decoders
 -p --prefix     directory prefix for files in archive
 -r --rev        revision to distribute
 -t --type       type of distribution to create
 -I --include    include names matching the given patterns
 -X --exclude    exclude names matching the given patterns
-r参数将接受标记名称,如果您不希望使用存档文件,则-t files将获得目录。

关于svn - 从Mercurial导出标签的未版本化副本,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/1663643/

10-13 07:14
查看更多