解决svn客户端版本冲突的python代码

以下代码存到文件里,文件另存为xxxx.py

#!/usr/bin/env python 
# 
#windows的svn版本和虚拟机的svn版本不同,且用其中的高版本进行提交后,造成低版本无法执行svn命令  
# change-svn-wc-format.py: Change the format of a Subversion working copy. 
# 
#命令:    ./change-svn-format.py ./   "1.4" --verbose       1.4是版本号 
# ==================================================================== 
#    Licensed to the Apache Software Foundation (ASF) under one 
#    or more contributor license agreements.  See the NOTICE file 
#    distributed with this work for additional information 
#    regarding copyright ownership.  The ASF licenses this file 
#    to you under the Apache License, Version 2.0 (the 
#    "License"); you may not use this file except in compliance 
#    with the License.  You may obtain a copy of the License at 
# 
#      http://www.apache.org/licenses/LICENSE-2.0 
# 
#    Unless required by applicable law or agreed to in writing, 
#    software distributed under the License is distributed on an 
#    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
#    KIND, either express or implied.  See the License for the 
#    specific language governing permissions and limitations 
#    under the License. 
# ==================================================================== 
import sys 
import os 
import getopt 
try: 
  my_getopt = getopt.gnu_getopt 
except AttributeError: 
  my_getopt = getopt.getopt 
### The entries file parser in subversion/tests/cmdline/svntest/entry.py 
### handles the XML-based WC entries file format used by Subversion 
### 1.3 and lower.  It could be rolled into this script. 
LATEST_FORMATS = { "1.4" : 8, 
                   "1.5" : 9, 
                   "1.6" : 10, 
                   # Do NOT add format 11 here.  See comment in must_retain_fields 
                   # for why. 
                 } 
def usage_and_exit(error_msg=None): 
  """Write usage information and exit.  If ERROR_MSG is provide, that 
  error message is printed first (to stderr), the usage info goes to 
  stderr, and the script exits with a non-zero status.  Otherwise, 
  usage info goes to stdout and the script exits with a zero status."""
  progname = os.path.basename(sys.argv[0]) 
  stream = error_msg and sys.stderr or sys.stdout 
  if error_msg: 
    stream.write("ERROR: %s\n\n" % error_msg) 
  stream.write("""\ 
usage: %s WC_PATH SVN_VERSION [--verbose] [--force] [--skip-unknown-format] 
       %s --help 
Change the format of a Subversion working copy to that of SVN_VERSION. 
  --skip-unknown-format    : s
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值