contrib/convert-repo
author Patrick Mezard <pmezard@gmail.com>
Fri, 02 Dec 2011 17:38:07 +0100
changeset 15605 2ad5b8937d0d
parent 6365 1d3eb332f3cb
permissions -rwxr-xr-x
convert/svn: update svn working copy only when necessary I have not tried to produce the bug but here is idea: f85c0034a062 stopped passing the modified files list to commit. This makes commit more fragile since we better not touch unrelated files by mistake. But putcommit() still applies file changes before exiting upon ignored revisions. So in theory, we could apply changes from a skipped branch then commit them as part of another revision. This patch makes the sink apply the changes after possibly skipping the revision. The real fix would be to use svn commit --targets option to pass the file names in an argument file. Unfortunately, it seems to be bugged in svn 1.7.1: http://svn.haxx.se/dev/archive-2011-11/0211.shtml

#!/usr/bin/env python
#
# Wrapper script around the convert.py hgext extension
# for foreign SCM conversion to mercurial format.
#

import sys
from mercurial import ui, fancyopts
from hgext import convert

# Options extracted from the cmdtable
func, options, help = convert.cmdtable['convert']

# An ui instance
u = ui.ui()

opts = {}
args = []
try:
    args = list(fancyopts.fancyopts(sys.argv[1:], options, opts))
    args += [None]*(3 - len(args))
    src, dest, revmapfile = args
except (fancyopts.getopt.GetoptError, ValueError), inst:
    u.warn('Usage:\n%s\n' % help)
    sys.exit(-1)

convert.convert(u, src, dest, revmapfile, **opts)