以下代码存到文件里,文件另存为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