SVN部分镜像

时间:2014-01-26 00:23:13

标签: git svn version-control mirror

无论如何,无论是使用SVN还是git-svn,都要克隆我具有只读访问权限的存储库的修订版本的子集?例如,我想要一个当前处于修订版200000的巨型存储库的脱机缓存,但是不希望在190000之前需要任何修订。svnsync可以处理从1-200000中检出每个修订版本,但可能是一个多天的过程,占用10英镑的空间。是否可以结合修订版190000的svn结帐/导出以及190000-200000中每个修订的更改集?

svnsync似乎没有任何选项可以限制所提取的修订集,当我尝试将-r 190000:200000选项与git-svn一起使用时,似乎只做了第二部分,将每个修订的更改作为提交而不是修订版190000中的存储库状态。我还尝试创建一个新的git仓库,然后svn export <remote_repo_URL>@190000,然后是git svn fetch -r 190000:200000 <remote_repo_url> ,但是git-svn拒绝使用尚未创建的git回购邮件。

奖金:我预计不会再进行进一步修订,但如果需要意外出现,是否还有一种方法可以添加早期版本(即:在给定示例中190000之前的修订版本) )?

2 个答案:

答案 0 :(得分:0)

不确定git但mercurial svn有一个关键字--startrev,所以你可以尝试:

hg clone --startrev 190000 svn+ URL

值得生成作者列表并使用-A。

提供

您还可以克隆特定分支。

hg -v help clone

的结果
  

hg clone [OPTION] ... SOURCE [DEST]

     

制作现有存储库的副本

Create a copy of an existing repository in a new directory.

If no destination directory name is specified, it defaults to the basename
of the source.

The location of the source is added to the new repository's ".hg/hgrc"
file, as the default to be used for future pulls.

Only local paths and "ssh://" URLs are supported as destinations. For
"ssh://" destinations, no working directory or ".hg/hgrc" will be created
on the remote side.

To pull only a subset of changesets, specify one or more revisions
identifiers with -r/--rev or branches with -b/--branch. The resulting
clone will contain only the specified changesets and their ancestors.
These options (or 'clone src#rev dest') imply --pull, even for local
source repositories. Note that specifying a tag will include the tagged
changeset but not the changeset containing the tag.

If the source repository has a bookmark called '@' set, that revision will
be checked out in the new repository by default.

To check out a particular version, use -u/--update, or -U/--noupdate to
create a clone with no working directory.

For efficiency, hardlinks are used for cloning whenever the source and
destination are on the same filesystem (note this applies only to the
repository data, not to the working directory). Some filesystems, such as
AFS, implement hardlinking incorrectly, but do not report errors. In these
cases, use the --pull option to avoid hardlinking.

In some cases, you can clone repositories and the working directory using
full hardlinks with

  $ cp -al REPO REPOCLONE

This is the fastest way to clone, but it is not always safe. The operation
is not atomic (making sure REPO is not modified during the operation is up
to you) and you have to make sure your editor breaks hardlinks (Emacs and
most Linux Kernel tools do so). Also, this is not compatible with certain
extensions that place their metadata under the .hg directory, such as mq.

Mercurial will update the working directory to the first applicable
revision from this list:

a) null if -U or the source repository has no changesets
b) if -u . and the source repository is local, the first parent of the
   source repository's working directory
c) the changeset specified with -u (if a branch name, this means the
   latest head of that branch)
d) the changeset specified with -r
e) the tipmost head specified with -b
f) the tipmost head specified with the url#branch source syntax
g) the revision marked with the '@' bookmark, if present
h) the tipmost head of the default branch
i) tip

Examples:

- clone a remote repository to a new directory named hg/:

    hg clone http://selenic.com/hg

- create a lightweight local clone:

    hg clone project/ project-feature/

- clone from an absolute path on an ssh server (note double-slash):

    hg clone ssh://user@server//home/projects/alpha/

- do a high-speed clone over a LAN while checking out a specified version:

    hg clone --uncompressed http://server/repo -u 1.5

- create a repository without changesets after a particular revision:

    hg clone -r 04e544 experimental/ good/

- clone (and track) a particular named branch:

    hg clone http://selenic.com/hg#stable

See "hg help urls" for details on specifying URLs.

Returns 0 on success.

Subversion sources can be used for clone. See 'hg help hgsubversion' for
more on the conversion process.
     

选项:

     

-U --noupdate克隆将包含一个空的工作副本   (只有一个                           存储库)-u --updaterev REV修订,标记或分支检查-r --rev REV [+]包括   指定的变更集-b --branch BRANCH [+]仅克隆指定的   科       --pull使用pull协议来复制元数据        - 未压缩使用未压缩传输(快速通过LAN)-e --ssh CMD指定要使用的ssh命令       --remotecmd CMD指定要在远程端运行的hg命令       --insecure不验证服务器证书(忽略web.cacerts                           配置)       --stupid使用较慢但更兼容的协议                           Subversion -T --tagpaths在Subversion中搜索标签的路径的VALUE列表                           资料库       --branchdir VALUE路径,用于在subversion存储库中搜索分支       --infix VALUE path to relative to trunk,branch a tag dirs to import -A -authors VALUE file mapping Subversion usernames to   Mercurial作者       --filemap包含重新映射Subversion的规则的VALUE文件                           存储库路径       --layout VALUE导入标准布局还是单个目录?可                           标准,单一或自动。 (默认:自动)       --branchmap包含分支转换规则的VALUE文件       --tagmap VALUE文件,包含重命名标记的规则       --startrev VALUE转换从一开始的Subversion修订版                           指定,整数修订版或HEAD;头                           导致只提取最新版本

     

[+]标记选项可以多次指定

     

全球选项:

     

-R --repository REPO存储库根目录或覆盖名称   束                           文件       --cwd DIR更改工作目录-y --noninteractive不提示,自动选择第一个选项                           所有提示-q --quiet suppress输出-v --verbose启用附加输出       --config CONFIG [+]设置/覆盖配置选项(使用'section.name = value')       --debug启用调试输出       --debugger启动调试器       --encoding ENCODE设置charset编码(默认值:UTF-8)       --encodingmode MODE设置charset编码模式(默认值:strict)       --traceback总是在异常上打印回溯        - 时间命令需要多长时间       --profile打印命令执行配置文件       --version输出版本信息并退出-h --help显示帮助和退出        - 隐藏考虑隐藏的变更集       --color TYPE何时着色(boolean,always,auto或never)                           (默认:自动)

     

[+]标记选项可以多次指定

答案 1 :(得分:0)

您可以尝试svnrdump:对于svnrdump dump,它接受​​修订版(或通常Subversion格式的版本范围)并在此情况下转储仅指定范围