Refactoring util.py

Christian Ebert blacktrash at gmx.net
Fri Mar 27 12:14:59 CDT 2009


* Christian Ebert on Friday, March 27, 2009 at 13:12:04 +0100
> * Matt Mackall on Thursday, March 26, 2009 at 14:15:20 -0500
>> I just pushed a big refactoring of util. We now have four files:
>> 
>> util.py: OS-independent utility functions, which imports:
>> posix.py: POSIX implementations of some things
>> windows.py: Windows implementations of some things, which imports:
>> win32.py: Windows implementations of some things using pywin32
>> 
>> As util is still pretty damn big and ugly, I'm planning to go further
>> down this path. Candidates include:
>> 
>> - moving date functions into their own module
>> - moving the remainder of the matching functions into match.py
>> - moving the string encoding magic to i18n.py
> 
> With this "make build", "python setup.py --version",
> "python setup.py clean -a" give tracebacks:

The problem is "python setup.py --version" on MacOS X (again).
> 
> [...]
> File "/Users/chris/HGworkspace/hg-crew-mq/mercurial/demandimport.py", line 75, in __getattribute__
>    self._load()
>  File "/Users/chris/HGworkspace/hg-crew-mq/mercurial/demandimport.py", line 47, in _load
>    mod = _origimport(head, globals, locals)
>  File "/Users/chris/HGworkspace/hg-crew-mq/mercurial/util.py", line 1069, in <module>
>    class atomictempfile(posixfile):
> NameError: name 'posixfile' is not defined
> 
> Is it because demandimport cannot handle "import *"?

It seems that getversion() using pure.py in setup.py strikes
again on MacOS X with that change. If I use just
os.popen('hg id -it') I get no traceback.

c
-- 
  Was heißt hier Dogma, ich bin Underdogma!
[ What the hell do you mean dogma, I am underdogma. ]
_F R E E_  _V I D E O S_  http://www.blacktrash.org/underdogma/
                          http://www.blacktrash.org/underdogma/index-en.html


More information about the Mercurial-devel mailing list