【问题标题】:SVN partial mirrorSVN部分镜像
【发布时间】:2014-01-26 00:23:13
【问题描述】:

无论如何,无论是使用 SVN 还是 git-svn,都可以克隆我具有只读访问权限的存储库的修订子集?例如,我想要一个当前处于修订版 200000 的巨大存储库的离线缓存,但不要期望在 190000 之前不需要任何修订版。svnsync 可以处理从 1 到 200000 的每个修订版的签出,但是这可能是一个多天的过程,占用 10 GB 的空间。是否可以将修订版 190000 的 svn 签出/导出以及从 190000-200000 的每个修订版的更改集结合起来?

svnsync 似乎没有任何选项来限制被拉取的修订集,当我尝试将-r 190000:200000 选项与git-svn 一起使用时,它似乎只做第二部分,拉动更改从每个版本作为提交,但不是版本 190000 的存储库状态。我还尝试创建一个新的git repo,然后是svn export <remote_repo_URL>@190000,然后是git svn fetch -r 190000:200000 <remote_repo_url>,但git-svn 拒绝在@987654329 上工作@repo 它没有创建。

奖励:我不认为必须返回进一步的修订,但如果需要意外出现,有没有办法也添加早期修订(即:在给定示例中的 190000 之前的修订)?

【问题讨论】:

    标签: git svn version-control mirror


    【解决方案1】:

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

    hg clone --startrev 190000 svn+网址

    值得生成一个作者列表并使用 -A 提供该列表。

    你也可以克隆一个特定的分支。

    hg -v help clone的结果

    hg 克隆 [OPTION]... 源 [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 协议复制元数据 --uncompressed 使用未压缩传输(通过 LAN 快速) -e --ssh CMD 指定要使用的 ssh 命令 --remotecmd CMD 指定 hg 命令在远程端运行 --insecure 不验证服务器证书(忽略 web.cacerts 配置) --stupid 使用更慢但更兼容的协议 Subversion -T --tagpaths VALUE 在 Subversion 中搜索标签的路径列表 存储库 --branchdir VALUE 路径在颠覆存储库中搜索分支 --infix VALUE 相对于主干的路径,分支标签目录以导入 -A --authors VALUE 文件映射 Subversion 用户名到 水银作者 --filemap VALUE 文件,包含重新映射 Subversion 的规则 存储库路径 --layout VALUE 导入标准布局还是单个目录?可 标准、单一或自动。 (默认:自动) --branchmap VALUE 文件包含分支转换的规则 --tagmap VALUE 文件包含重命名标签的规则 --startrev VALUE 转换从第一个开始的 Subversion 版本 指定,整数版本或 HEAD;头 导致仅提取最新版本

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

    全局选项:

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

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

    【讨论】:

      【解决方案2】:

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2011-10-16
        • 1970-01-01
        • 1970-01-01
        • 2011-01-19
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多