changeset 7837:db39b6c3da48

merge with -stable
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Sat, 07 Mar 2009 20:30:20 +0100
parents bc0a87123ab8 (diff) 794def2fe232 (current diff)
children c2e962bdcc37
files
diffstat 6 files changed, 33 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/win32/ReadMe.html	Sat Mar 07 20:16:03 2009 +0100
+++ b/contrib/win32/ReadMe.html	Sat Mar 07 20:30:20 2009 +0100
@@ -93,7 +93,7 @@
 	href="http://www.serpentine.com/blog">Bryan
 	O'Sullivan</a>.</p>
 
-    <p>Mercurial is Copyright 2005-2008 Matt Mackall and others.
+    <p>Mercurial is Copyright 2005-2009 Matt Mackall and others.
 	See the <tt>Contributors.txt</tt> file for a list of contributors.</p>
 
     <p>Mercurial is free software; you can redistribute it and/or
--- a/mercurial/commands.py	Sat Mar 07 20:16:03 2009 +0100
+++ b/mercurial/commands.py	Sat Mar 07 20:30:20 2009 +0100
@@ -2942,7 +2942,7 @@
     ui.write(_("Mercurial Distributed SCM (version %s)\n")
              % util.version())
     ui.status(_(
-        "\nCopyright (C) 2005-2008 Matt Mackall <mpm@selenic.com> and others\n"
+        "\nCopyright (C) 2005-2009 Matt Mackall <mpm@selenic.com> and others\n"
         "This is free software; see the source for copying conditions. "
         "There is NO\nwarranty; "
         "not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"
--- a/mercurial/help.py	Sat Mar 07 20:16:03 2009 +0100
+++ b/mercurial/help.py	Sat Mar 07 20:30:20 2009 +0100
@@ -98,7 +98,7 @@
 HG::
     Path to the 'hg' executable, automatically passed when running hooks,
     extensions or external tools. If unset or empty, this is the hg
-    exutable's name if it's frozen, or an executable named 'hg'
+    executable's name if it's frozen, or an executable named 'hg'
     (with %PATHEXT% [defaulting to COM/EXE/BAT/CMD] extensions on
     Windows) is searched.
 
--- a/mercurial/pure/base85.py	Sat Mar 07 20:16:03 2009 +0100
+++ b/mercurial/pure/base85.py	Sat Mar 07 20:30:20 2009 +0100
@@ -9,6 +9,7 @@
 
 _b85chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" \
             "abcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~"
+_b85chars2 = [(a + b) for a in _b85chars for b in _b85chars]
 _b85dec = {}
 
 def _mkb85dec():
@@ -22,24 +23,13 @@
     if r:
         text += '\0' * (4 - r)
     longs = len(text) >> 2
-    out = []
     words = struct.unpack('>%dL' % (longs), text)
-    for word in words:
-        # unrolling improved speed by 33%
-        word, r = divmod(word, 85)
-        e = _b85chars[r]
-        word, r = divmod(word, 85)
-        d = _b85chars[r]
-        word, r = divmod(word, 85)
-        c = _b85chars[r]
-        word, r = divmod(word, 85)
-        b = _b85chars[r]
-        word, r = divmod(word, 85)
-        a = _b85chars[r]
 
-        out += (a, b, c, d, e)
+    out = ''.join(_b85chars[(word / 52200625) % 85] + 
+                  _b85chars2[(word / 7225) % 7225] +
+                  _b85chars2[word % 7225]
+                  for word in words)
 
-    out = ''.join(out)
     if pad:
         return out
 
--- a/setup.py	Sat Mar 07 20:16:03 2009 +0100
+++ b/setup.py	Sat Mar 07 20:30:20 2009 +0100
@@ -97,7 +97,10 @@
 except ImportError:
     pass
 
-try:
+def getversion():
+    if not os.path.exists('.hg'):
+        return None # not in a repository
+
     # execute hg out of this directory with a custom environment which
     # includes the pure Python modules in mercurial/pure
     pypath = os.environ.get('PYTHONPATH', '')
@@ -105,23 +108,31 @@
     os.environ['PYTHONPATH'] = os.pathsep.join(['mercurial', purepath, pypath])
     os.environ['HGRCPATH'] = '' # do not read any config file
     cmd = '%s hg id -it' % sys.executable
-    l = os.popen(cmd).read().split()
+
+    try:
+        l = os.popen(cmd).read().split()
+    except OSError, e:
+        print "warning: could not establish Mercurial version: %s" % e
+
     os.environ['PYTHONPATH'] = pypath
+
     while len(l) > 1 and l[-1][0].isalpha(): # remove non-numbered tags
         l.pop()
-    version = l and l[-1] or 'unknown' # latest tag or revision number
-    if version.endswith('+'):
-        version += time.strftime('%Y%m%d')
+    if l:
+        version = l[-1] # latest tag or revision number
+        if version.endswith('+'):
+            version += time.strftime('%Y%m%d')
+        return version
 
-except OSError, e:
-    print "warning: could not establish Mercurial version: %s" % e
+version = getversion()
+if version:
+    f = file("mercurial/__version__.py", "w")
+    f.write('# this file is autogenerated by setup.py\n')
+    f.write('version = "%s"\n' % version)
+    f.close()
+else:
     version = "unknown"
 
-f = file("mercurial/__version__.py", "w")
-f.write('# this file is autogenerated by setup.py\n')
-f.write('version = "%s"\n' % version)
-f.close()
-
 class install_package_data(install_data):
     def finalize_options(self):
         self.set_undefined_options('install',
--- a/tests/test-identify	Sat Mar 07 20:16:03 2009 +0100
+++ b/tests/test-identify	Sat Mar 07 20:30:20 2009 +0100
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+"$TESTDIR/hghave" no-outer-repo || exit 80
+
 echo % no repo
 hg id