Rev 5980: Merge 2.3 into trunk in http://bazaar.launchpad.net/~vila/bzr/integration/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Thu Jun 16 18:34:28 UTC 2011
At http://bazaar.launchpad.net/~vila/bzr/integration/
------------------------------------------------------------
revno: 5980 [merge]
revision-id: v.ladeuil+lp at free.fr-20110616183426-oj818x56zm7yzvb8
parent: pqm at pqm.ubuntu.com-20110616173940-cwkewi54lnqest66
parent: v.ladeuil+lp at free.fr-20110616183144-e012lhwlw562r1uc
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: trunk
timestamp: Thu 2011-06-16 20:34:26 +0200
message:
Merge 2.3 into trunk
modified:
bzrlib/osutils.py osutils.py-20050309040759-eeaff12fbf77ac86
bzrlib/tests/features.py features.py-20090820042958-jglgza3wrn03ha9e-1
bzrlib/tests/test_osutils.py test_osutils.py-20051201224856-e48ee24c12182989
doc/en/release-notes/bzr-2.3.txt NEWS-20050323055033-4e00b5db738777ff
setup.py setup.py-20050314065409-02f8a0a6e3f9bc70
-------------- next part --------------
=== modified file 'bzrlib/osutils.py'
--- a/bzrlib/osutils.py 2011-05-27 03:40:07 +0000
+++ b/bzrlib/osutils.py 2011-06-16 18:34:26 +0000
@@ -2381,6 +2381,18 @@
except UnicodeDecodeError:
raise errors.BzrError("Can't decode username as %s." % \
user_encoding)
+ except ImportError, e:
+ if sys.platform != 'win32':
+ raise
+ if str(e) != 'No module named pwd':
+ raise
+ # https://bugs.launchpad.net/bzr/+bug/660174
+ # getpass.getuser() is unable to return username on Windows
+ # if there is no USERNAME environment variable set.
+ # That could be true if bzr is running as a service,
+ # e.g. running `bzr serve` as a service on Windows.
+ # We should not fail with traceback in this case.
+ username = u'UNKNOWN'
return username
=== modified file 'bzrlib/tests/features.py'
--- a/bzrlib/tests/features.py 2011-03-14 12:43:19 +0000
+++ b/bzrlib/tests/features.py 2011-06-16 18:34:26 +0000
@@ -18,6 +18,7 @@
import os
import stat
+import sys
from bzrlib import (
osutils,
@@ -127,3 +128,17 @@
bash_feature = ExecutableFeature('bash')
sed_feature = ExecutableFeature('sed')
diff_feature = ExecutableFeature('diff')
+
+
+class Win32Feature(tests.Feature):
+ """Feature testing whether we're running selftest on Windows
+ or Windows-like platform.
+ """
+
+ def _probe(self):
+ return sys.platform == 'win32'
+
+ def feature_name(self):
+ return "win32 platform"
+
+win32_feature = Win32Feature()
=== modified file 'bzrlib/tests/test_osutils.py'
--- a/bzrlib/tests/test_osutils.py 2011-05-13 12:51:05 +0000
+++ b/bzrlib/tests/test_osutils.py 2011-06-16 18:34:26 +0000
@@ -2052,6 +2052,7 @@
# Whatever the result is, if we don't raise an exception, it's ok.
osutils.terminal_width()
+
class TestCreationOps(tests.TestCaseInTempDir):
_test_needs_features = [features.chown_feature]
@@ -2087,6 +2088,7 @@
self.assertEquals(self.uid, s.st_uid)
self.assertEquals(self.gid, s.st_gid)
+
class TestGetuserUnicode(tests.TestCase):
def test_ascii_user(self):
@@ -2107,6 +2109,13 @@
self.overrideEnv('LOGNAME', u'jrandom\xb6'.encode(ue))
self.assertEqual(u'jrandom\xb6', osutils.getuser_unicode())
+ def test_no_username_bug_660174(self):
+ self.requireFeature(features.win32_feature)
+ for name in ('LOGNAME', 'USER', 'LNAME', 'USERNAME'):
+ self.overrideEnv(name, None)
+ self.assertEqual(u'UNKNOWN', osutils.getuser_unicode())
+
+
class TestBackupNames(tests.TestCase):
def setUp(self):
=== modified file 'doc/en/release-notes/bzr-2.3.txt'
--- a/doc/en/release-notes/bzr-2.3.txt 2011-06-09 15:13:54 +0000
+++ b/doc/en/release-notes/bzr-2.3.txt 2011-06-16 18:34:26 +0000
@@ -33,6 +33,10 @@
.. Fixes for situations where bzr would previously crash or give incorrect
or undesirable results.
+* Don't fail with traceback if `bzr serve` is running as a service on Windows,
+ and there is no USERNAME, nor BZR_EMAIL or other whoami-related environment
+ variables set. (Alexander Belchenko, Bug #660174)
+
Documentation
*************
=== modified file 'setup.py'
--- a/setup.py 2011-05-26 21:24:36 +0000
+++ b/setup.py 2011-06-16 18:34:26 +0000
@@ -478,6 +478,12 @@
packages.append('sqlite3')
+def get_fastimport_py2exe_info(includes, excludes, packages):
+ # This is the python-fastimport package, not to be confused with the
+ # bzr-fastimport plugin.
+ packages.append('fastimport')
+
+
if 'bdist_wininst' in sys.argv:
def find_docs():
docs = []
@@ -670,6 +676,9 @@
if 'svn' in plugins:
get_svn_py2exe_info(includes, excludes, packages)
+ if 'fastimport' in plugins:
+ get_fastimport_py2exe_info(includes, excludes, packages)
+
if "TBZR" in os.environ:
# TORTOISE_OVERLAYS_MSI_WIN32 must be set to the location of the
# TortoiseOverlays MSI installer file. It is in the TSVN svn repo and
More information about the bazaar-commits
mailing list