Merge with crew-stable.
--- a/hgext/convert/common.py Thu Nov 01 12:17:59 2007 -0700
+++ b/hgext/convert/common.py Thu Nov 01 15:22:10 2007 -0700
@@ -1,6 +1,7 @@
# common code for the convert extension
import base64
import cPickle as pickle
+from mercurial import util
def encodeargs(args):
def encodearg(s):
@@ -15,6 +16,11 @@
s = base64.decodestring(s)
return pickle.loads(s)
+def checktool(exe, name=None):
+ name = name or exe
+ if not util.find_exe(exe):
+ raise util.Abort('cannot find required "%s" tool' % name)
+
class NoRepo(Exception): pass
SKIPREV = 'SKIP'
--- a/hgext/convert/cvs.py Thu Nov 01 12:17:59 2007 -0700
+++ b/hgext/convert/cvs.py Thu Nov 01 15:22:10 2007 -0700
@@ -3,7 +3,7 @@
import os, locale, re, socket
from mercurial import util
-from common import NoRepo, commit, converter_source
+from common import NoRepo, commit, converter_source, checktool
class convert_cvs(converter_source):
def __init__(self, ui, path, rev=None):
@@ -13,6 +13,9 @@
if not os.path.exists(cvs):
raise NoRepo("couldn't open CVS repo %s" % path)
+ for tool in ('cvsps', 'cvs'):
+ checktool(tool)
+
self.changeset = {}
self.files = {}
self.tags = {}
--- a/hgext/convert/darcs.py Thu Nov 01 12:17:59 2007 -0700
+++ b/hgext/convert/darcs.py Thu Nov 01 15:22:10 2007 -0700
@@ -1,6 +1,6 @@
# darcs support for the convert extension
-from common import NoRepo, commit, converter_source
+from common import NoRepo, commit, converter_source, checktool
from mercurial.i18n import _
from mercurial import util
import os, shutil, tempfile
@@ -24,6 +24,8 @@
if not os.path.exists(os.path.join(path, '_darcs', 'inventory')):
raise NoRepo("couldn't open darcs repo %s" % path)
+ checktool('darcs')
+
if ElementTree is None:
raise util.Abort(_("Python ElementTree module is not available"))
--- a/hgext/convert/git.py Thu Nov 01 12:17:59 2007 -0700
+++ b/hgext/convert/git.py Thu Nov 01 15:22:10 2007 -0700
@@ -3,7 +3,7 @@
import os
from mercurial import util
-from common import NoRepo, commit, converter_source
+from common import NoRepo, commit, converter_source, checktool
class convert_git(converter_source):
# Windows does not support GIT_DIR= construct while other systems
@@ -31,6 +31,9 @@
path += "/.git"
if not os.path.exists(path + "/objects"):
raise NoRepo("couldn't open GIT repo %s" % path)
+
+ checktool('git-rev-parse', 'git')
+
self.path = path
def getheads(self):
--- a/hgext/gpg.py Thu Nov 01 12:17:59 2007 -0700
+++ b/hgext/gpg.py Thu Nov 01 15:22:10 2007 -0700
@@ -249,7 +249,7 @@
message = opts['message']
if not message:
message = "\n".join([_("Added signature for changeset %s")
- % hgnode.hex(n)
+ % hgnode.short(n)
for n in nodes])
try:
repo.commit([".hgsigs"], message, opts['user'], opts['date'])
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-execute-bit Thu Nov 01 15:22:10 2007 -0700
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+"$TESTDIR/hghave" execbit || exit 80
+
+hg init
+echo a > a
+hg ci -d'0 0' -Am'not executable'
+
+chmod +x a
+hg ci -d'1 0' -m'executable'
+hg id
+
+hg up 0
+hg id
+test -x a && echo executable -- eek || echo not executable -- whew
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-execute-bit.out Thu Nov 01 15:22:10 2007 -0700
@@ -0,0 +1,5 @@
+adding a
+1549299e88d1 tip
+0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+d69afc33ff8a
+not executable -- whew