windows selftest rev 1372
John A Meinel
john at arbash-meinel.com
Fri Oct 28 17:26:23 BST 2005
Aaron Bentley wrote:
> Alexey Shamrin wrote:
>>> Here is one small fix to get 15 errors on windows (instead of 16):
>>> This is because on Windows HOME is usually not set.
>
> It looks like a more correct fix would be to unset HOME, instead of
> setting it to ''. I've attached a fix to do that. Does it work equally
> well?
>
> By the way, does GNU diff (not bzr diff) on Windows use backslashes or
> forward slashes?
>
> Aaron
Speaking of this specific fix, has anyone looked into my win32 patch for
moving bzr's home to $APPDATA?
It works on my machine, but I have both APPDATA and HOME set, so I
probably need to update it with this patch as well.
John
=:->
------------------------------------------------------------------------
=== modified file 'bzrlib/selftest/__init__.py'
--- bzrlib/selftest/__init__.py
+++ bzrlib/selftest/__init__.py
@@ -265,8 +265,15 @@
del os.environ['EMAIL']
self.addCleanup(self._restoreEnvironment)
+ @staticmethod
+ def _restoreVar(name, value):
+ if value is None:
+ del os.environ[name]
+ else:
+ os.environ[name] = value
+
def _restoreEnvironment(self):
- os.environ['HOME'] = self.oldenv
+ self._restoreVar('HOME', self.oldenv)
if os.environ.get('BZREMAIL') is not None:
del os.environ['BZREMAIL']
if self.bzr_email is not None:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051028/3ed11079/attachment.pgp
More information about the bazaar
mailing list