如何使SVN的混帐svn的使用特定版本? [英] How to make git-svn use specific version of SVN?

查看:257
本文介绍了如何使SVN的混帐svn的使用特定版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Linux机器我同时使用SVN和Git。

On my Linux machine I use both SVN and Git.

为了使我的生活更轻松,我添加
    来源/opt/svn/linux64/ix86/svn_1.8.5/interface/startup/svn_1.8.5_64.env
我的的.bashrc ,因此写作
    SVN -version
显示1.8.5预期。

To make my life easier I added source /opt/svn/linux64/ix86/svn_1.8.5/interface/startup/svn_1.8.5_64.env to my .bashrc and thus writing svn –version shows 1.8.5 as expected.

不过,有这个时混帐SVN 失败后结帐。这发生在Git的1.7.10.1,是一个已知的不兼容(例如,见这里)。

But when having this git-svn fails upon checkout. This happens in Git 1.7.10.1 and is an already known incompatibility (see for example here).

我可以很容易地通过 ING SVN版本1.7.9解决它。但是,这需要我重新启动SSH连接。然后执行混帐svn的操作再次重启后。 (在这两种情况下,的.bashrc 已被编辑!)

I can easily work around it by sourceing SVN version 1.7.9. But that requires me to restart SSH connection. And then after performing git-svn operation restarting again. (In both cases .bashrc has to be edited!)

我也可以直接切换到SVN 1.7.9但这需要我降级所有SVN工具,我使用,包括TortoiseSVN的,我有我的Windows机器上(和我不时使用时间上共享网络驱动器制作检出)。

I could also just switch to SVN 1.7.9 but that would require me to downgrade all SVN tools I use including TortoiseSVN which I have on my Windows machine (and which I use from time to time on checkouts made on shared network drives).

那么,有没有一个非侵入式的方式(所以我只能自己做了! - 在Linux是一个共享的服务器上),使混帐SVN 使用1.7.9版本,而命令行仍将使用1.8.5?

So is there a "non-intrusive" way (so I can do it only for myself – the Linux is on a shared server!) to make git-svn use the 1.7.9 version while command line will still use 1.8.5?

/opt/svn/linux64/ix86/svn_1.8.5/interface/startup/svn_1.8.5_64.env 包含以下内容:

add_to_env()
{
old_value=`eval echo '$'${1}`
eval ${1}=`echo ${old_value}|awk '{ n=split($1,parts,":"); printf "%s", toadd ;
for (i = 1; i <= n; ++i) if ( toadd != parts[i]  ) printf ":%s", parts[i]; }' toadd=${2}`
}

if [ -n "$SVN_STARTUP" ]; then
  SVN_TMP=$SVN_STARTUP
  unset SVN_STARTUP
  . $SVN_TMP
else
  # setum and setmake can overrule SVN_VERSION
  if [ -z "$SVN_VERSION" ]; then
    export SVN_VERSION=svn_1.8.5
  fi
  export SVN_HOME=/opt/svn/linux64/ix86/$SVN_VERSION
  add_to_env PATH $SVN_HOME/bin
  export PATH
  add_to_env MANPATH $SVN_HOME/share/man
  export MANPATH
  add_to_env LD_LIBRARY_PATH $SVN_HOME/lib
  export LD_LIBRARY_PATH
fi


至于Perl的:


As to Perl:


  • 的perl --version 显示5.8.8,

  • 其perl的显示的/ usr / bin中/ perl的这是不是一个链接,在/ usr /斌还包含 perl5.8.8 这似乎是(按差异)是同样的,

  • 查找/ -name Ra.pm 发现(到目前为止...) /usr/lib64/perl5/vendor_perl/5.8.8/x86_64- Linux的线程多/ SVN / Ra.pm

  • perl --version shows 5.8.8,
  • which perl shows /usr/bin/perl which is not a link, /usr/bin contains also perl5.8.8 which seems (by diff) to be the same,
  • find / -name Ra.pm finds (so far…) /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/SVN/Ra.pm.

推荐答案

首先是环境的脚本是不是真的改变你的绑定完全颠覆。事实上,它实际上是混合的绑定与图书馆的其他版本。一般来说,这很可能是工作,因为颠覆使得很多的努力,以保持我们的API兼容,你应该使用相同版本的各种颠覆库(这很重要)结束。

First of all that environment script isn't really changing your bindings to Subversion fully. In fact it's actually mixing bindings with some other version of the libraries. In general this is likely to work because Subversion makes a lot of effort to keep our APIs compatible and you should end up with the same version of the various Subversion libraries (which is important).

为了正确使用,与图书馆去颠覆Perl绑定,您需要的路径添加到Perl绑定正处于何处。 Perl的处理这与 PERL5LIB 环境。它的工作方式类似于你 PATH LD_LIBRARY_PATH 环境变量。其他语言需要类似的东西(但混​​帐svn的只使用Perl的所以这不是重要的,这种情况下)。

In order to correctly use the Subversion Perl bindings that go with the libraries you'll need to add the path to where the Perl bindings are at. Perl handles this with the PERL5LIB environment. Which works similarly to your PATH or LD_LIBRARY_PATH environment variables. Other languages would need similar things (but git-svn only uses Perl so that's not important in this case).

除此之外,你应该能够执行此脚本,在shell改变库,因为它增加了库中的值(这将在给定的顺序进行搜索)的开始。所以,你应该只能够运行源envfile 。 envfile

Beyond that you should just be able to source the script in your shell to change the libraries because it adds the libraries to the start of the values (which will be searched in the order given). So you should just be able to run source envfile or . envfile.

如果你想你可以简单地包裹混帐像这样的东西,并把它的路径上(你可以别名一样好,但脚本不会看到它)。

If you wanted you could simply wrap git with something like this and put it on your path (you could alias it as well but scripts wouldn't see it).

#!/bin/bash

. /opt/svn/linux64/ix86/svn_1.7.9/interface/startup/svn_1.7.9_64.env
export PERL5LIB="$SOMEPATHTOPERLLIBS:$PERL5LIB"

git "$@"

其中$ SOMEPATHTOPERLLIS被替换为任何的Perl5的文件的实际路径是在你安装。我不能告诉你这是什么它从系统而异。如果你搜索一个名为 Ra.pm文件通常可以找到的大致区域。您应该只需要一点,在那里你发现文件中的几级了。

Where $SOMEPATHTOPERLLIS is replaced with whatever the actual path to the Perl5 files are in your install. I can't tell you what this it varies from system to system. If you search for a file named Ra.pm you can usually find the general area. You should only need to point that at where you found that file a few levels up.

这篇关于如何使SVN的混帐svn的使用特定版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆