Merge with main
authorBrendan Cully <brendan@kublai.com>
Fri, 06 Mar 2009 12:35:48 -0800
changeset 7836 bc0a87123ab8
parent 7835 2505e9f84153 (current diff)
parent 7830 55bd03e2e13c (diff)
child 7837 db39b6c3da48
Merge with main
--- a/contrib/win32/ReadMe.html	Wed Mar 04 23:23:59 2009 +0100
+++ b/contrib/win32/ReadMe.html	Fri Mar 06 12:35:48 2009 -0800
@@ -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	Wed Mar 04 23:23:59 2009 +0100
+++ b/mercurial/commands.py	Fri Mar 06 12:35:48 2009 -0800
@@ -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	Wed Mar 04 23:23:59 2009 +0100
+++ b/mercurial/help.py	Fri Mar 06 12:35:48 2009 -0800
@@ -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/setup.py	Wed Mar 04 23:23:59 2009 +0100
+++ b/setup.py	Fri Mar 06 12:35:48 2009 -0800
@@ -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	Wed Mar 04 23:23:59 2009 +0100
+++ b/tests/test-identify	Fri Mar 06 12:35:48 2009 -0800
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+"$TESTDIR/hghave" no-outer-repo || exit 80
+
 echo % no repo
 hg id