[RFC][win32] bzr.exe -- launcher for bzr script

Alexander Belchenko bialix at ukr.net
Sun Jan 15 10:48:15 GMT 2006

Jan Hudec пишет:
> On Sun, Jan 15, 2006 at 04:25:42 +0200, Alexander Belchenko wrote:
>>I try to make exe launcher for bzr to use on win32. 
>>Unfortunately, when bzr launched within exemakered exe launcher this
>>condition is True and bzr won't work. I slightly change this to:
>>if not __debug__ and __doc__ is None:
>>     print "bzr does not support python -OO."
>>     sys.exit(2)
>>And it works. Mostly because from exe python executed without -O/-OO
>>options. I make this assumption by the fact that in bzrlib no .pyo files
>>appeared after bzr execution.
> Does it? Really? Does bzr help init (or any other command) print what it
> should?

And help commands works and prints what it should. See:

Bazaar-NG -- a free distributed version-control tool

WARNING: This is an unstable development version.
          Please keep backups.

Basic commands:

   bzr init           makes this directory a versioned branch
   bzr branch         make a copy of another branch

   bzr add            make files or directories versioned
   bzr ignore         ignore a file or pattern
   bzr mv             move or rename a versioned file

   bzr status         summarize changes in working copy
   bzr diff           show detailed diffs

   bzr merge          pull in changes from another branch
   bzr commit         save some or all changes

   bzr log            show history of changes
   bzr check          validate storage

   bzr help init      more help on e.g. init command
   bzr help commands  list all commands

E:\work\Python\_pys\exemaker-1.2-20041012>bzr.exe init -h
usage: bzr init [LOCATION]

Make a directory into a versioned branch.

Use this to create an empty branch, or before importing an
existing project.

Recipe for importing a tree of files:
     cd ~/project
     bzr init
     bzr add .
     bzr status
     bzr commit -m 'imported project'

     --help, -h                show help message

>>Is this acceptable change to bzr script or there is right way to avoid
>>this inside exe? Attached patch will change condition to determine -OO
>>python optimization option.
> But it is not trying to determine -OO, really. It is trying to determine
> presence of doc strings, which is exactly what it does. Because bzr keeps
> help and various messages in doc strings.

No. I disagree. This hack try to determine presence of __doc__ variable 
in the bzr script itself but not docstrings in the bzrlib package. Really.


More information about the bazaar mailing list