Re: [PATCH v1 02/25] contrib: remove 'hg-to-git'

2014-05-08 Thread Miklos Vajna
On Thu, May 08, 2014 at 07:58:13PM -0500, Felipe Contreras 
 wrote:
> There hasn't been any real activity on it since 2010.
> 
> Plus there are better out-of-tree tools.
> 
> No tests and no real documentation either.

ACK, "git clone hg::..." is what one is supposed to use today, I guess.


signature.asc
Description: Digital signature


[PATCH v1 02/25] contrib: remove 'hg-to-git'

2014-05-08 Thread Felipe Contreras
There hasn't been any real activity on it since 2010.

Plus there are better out-of-tree tools.

No tests and no real documentation either.

Cc: Miklos Vajna 
Signed-off-by: Felipe Contreras 
---
 contrib/hg-to-git/hg-to-git.py  | 255 
 contrib/hg-to-git/hg-to-git.txt |  21 
 2 files changed, 276 deletions(-)
 delete mode 100755 contrib/hg-to-git/hg-to-git.py
 delete mode 100644 contrib/hg-to-git/hg-to-git.txt

diff --git a/contrib/hg-to-git/hg-to-git.py b/contrib/hg-to-git/hg-to-git.py
deleted file mode 100755
index 60dec86..000
--- a/contrib/hg-to-git/hg-to-git.py
+++ /dev/null
@@ -1,255 +0,0 @@
-#!/usr/bin/env python
-
-""" hg-to-git.py - A Mercurial to GIT converter
-
-Copyright (C)2007 Stelian Pop 
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-"""
-
-import os, os.path, sys
-import tempfile, pickle, getopt
-import re
-
-if sys.hexversion < 0x0203:
-   # The behavior of the pickle module changed significantly in 2.3
-   sys.stderr.write("hg-to-git.py: requires Python 2.3 or later.\n")
-   sys.exit(1)
-
-# Maps hg version -> git version
-hgvers = {}
-# List of children for each hg revision
-hgchildren = {}
-# List of parents for each hg revision
-hgparents = {}
-# Current branch for each hg revision
-hgbranch = {}
-# Number of new changesets converted from hg
-hgnewcsets = 0
-
-#--
-
-def usage():
-
-print """\
-%s: [OPTIONS] 
-
-options:
--s, --gitstate=FILE: name of the state to be saved/read
- for incrementals
--n, --nrepack=INT:   number of changesets that will trigger
- a repack (default=0, -1 to deactivate)
--v, --verbose:   be verbose
-
-required:
-hgprj:  name of the HG project to import (directory)
-""" % sys.argv[0]
-
-#--
-
-def getgitenv(user, date):
-env = ''
-elems = re.compile('(.*?)\s+<(.*)>').match(user)
-if elems:
-env += 'export GIT_AUTHOR_NAME="%s" ;' % elems.group(1)
-env += 'export GIT_COMMITTER_NAME="%s" ;' % elems.group(1)
-env += 'export GIT_AUTHOR_EMAIL="%s" ;' % elems.group(2)
-env += 'export GIT_COMMITTER_EMAIL="%s" ;' % elems.group(2)
-else:
-env += 'export GIT_AUTHOR_NAME="%s" ;' % user
-env += 'export GIT_COMMITTER_NAME="%s" ;' % user
-env += 'export GIT_AUTHOR_EMAIL= ;'
-env += 'export GIT_COMMITTER_EMAIL= ;'
-
-env += 'export GIT_AUTHOR_DATE="%s" ;' % date
-env += 'export GIT_COMMITTER_DATE="%s" ;' % date
-return env
-
-#--
-
-state = ''
-opt_nrepack = 0
-verbose = False
-
-try:
-opts, args = getopt.getopt(sys.argv[1:], 's:t:n:v', ['gitstate=', 
'tempdir=', 'nrepack=', 'verbose'])
-for o, a in opts:
-if o in ('-s', '--gitstate'):
-state = a
-state = os.path.abspath(state)
-if o in ('-n', '--nrepack'):
-opt_nrepack = int(a)
-if o in ('-v', '--verbose'):
-verbose = True
-if len(args) != 1:
-raise Exception('params')
-except:
-usage()
-sys.exit(1)
-
-hgprj = args[0]
-os.chdir(hgprj)
-
-if state:
-if os.path.exists(state):
-if verbose:
-print 'State does exist, reading'
-f = open(state, 'r')
-hgvers = pickle.load(f)
-else:
-print 'State does not exist, first run'
-
-sock = os.popen('hg tip --template "{rev}"')
-tip = sock.read()
-if sock.close():
-sys.exit(1)
-if verbose:
-print 'tip is', tip
-
-# Calculate the branches
-if verbose:
-print 'analysing the branches...'
-hgchildren["0"] = ()
-hgparents["0"] = (None, None)
-hgbranch["0"] = "master"
-for cset in range(1, int(tip) + 1):
-hgchildren[str(cset)] = ()
-prnts = os.popen('hg log -r %d --template "{parents}"' % 
cset).read().strip().split(' ')
-prnts = map(lambda x: x[:x.find(':')], prnts)
-if prnts[0] != '':
-parent = prnts[0].strip()
-else:
-parent = str(cset - 1)
-hgchildren[parent] += ( str(cset), )
-if len(prnts) > 1:
-mparent = prnts[1].strip()
-hgchildren[mparent] += ( str(cset), )
-else:
-mpa