Merge lp:~garyvdm/bzr/bzrw into lp:bzr/2.2

Proposed by Gary van der Merwe
Status: Merged
Approved by: Gary van der Merwe
Approved revision: no longer in the source branch.
Merged at revision: 5069
Proposed branch: lp:~garyvdm/bzr/bzrw
Merge into: lp:bzr/2.2
Diff against target: 93 lines (+45/-1)
3 files modified
NEWS (+4/-0)
setup.py (+6/-1)
tools/win32/py2exe_boot_common.py (+35/-0)
To merge this branch: bzr merge lp:~garyvdm/bzr/bzrw
Reviewer Review Type Date Requested Status
Alexander Belchenko Approve
Review via email: mp+31133@code.launchpad.net

Commit message

(GaryvdM) Add bzrw as gui_target. Blackhole it's stderr with a custom py2exe boot script.

Description of the change

This addes py2exe windows target ``bzrw.exe``. This allow for starting a Bazaar GUI with out have a console open in the background.

Previous discussions about this:
https://lists.launchpad.net/bzr-windows/msg00095.html
https://lists.launchpad.net/bzr-windows/msg00307.html

As you can see, we have been trying to do this for a while now.

On of the problems that we had, is that, by default, if something is written to stderr, it is written to a log file, and a message box prompt is given. This is annoying, as the are many thing that may be written to stderr, which are not necessarily errors, while most errors are logged to .bzr.log anyway. I have overridden the py2exe script which does this, so that stderr, as well as stdout go to a blackhole.

There are still some issues where some prompts go to the console, which the user will not see when they are using this. I.e. when using openssh, and when using gpg (bug 336910).

To post a comment you must log in.
Revision history for this message
Gary van der Merwe (garyvdm) wrote :

Bailix reviewed & approved this. Please see: https://lists.launchpad.net/bzr-windows/msg00350.html

I've moved boot_common.py as per his recommendation, and built and test a new installer, to check that py2exe picks up the moved file.

I'll try submit to lp:bzr/2.2, but I think I might not have permissions to it.

Revision history for this message
Alexander Belchenko (bialix) :
review: Approve
Revision history for this message
Gary van der Merwe (garyvdm) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 02/08/2010 20:09, Gary van der Merwe wrote:
> I'll try submit to lp:bzr/2.2, but I think I might not have permissions to it.

I don't have permissions to lp:bzr/2.2. Please will someone who does
submit for me.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxXENwACgkQd/3EdwGKOh0a7QCgpObxI6MQ73PbHE4eqk+NGawv
NJAAn1aFTEZ/di6KC6NntMd0gPIF04jK
=5/HG
-----END PGP SIGNATURE-----

Revision history for this message
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Gary van der Merwe wrote:
> Bailix reviewed & approved this. Please see: https://lists.launchpad.net/bzr-windows/msg00350.html
>
> I've moved boot_common.py as per his recommendation, and built and test a new installer, to check that py2exe picks up the moved file.
>
> I'll try submit to lp:bzr/2.2, but I think I might not have permissions to it.

I'm pretty sure we changed the submit rights so that if you *have*
rights, you have rights to all pqm managed branches.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxXGuMACgkQJdeBCYSNAAP2vwCfYpKa2K5WQ0UJ4knFrRUp2YWM
AT0AnAlDRnEWs+cR7KHBugiu9vf5ZOfS
=LI8U
-----END PGP SIGNATURE-----

Revision history for this message
Gary van der Merwe (garyvdm) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 02/08/2010 21:22, John Arbash Meinel wrote:
> Gary van der Merwe wrote:
>> I'll try submit to lp:bzr/2.2, but I think I might not have permissions to it.
>
> I'm pretty sure we changed the submit rights so that if you *have*
> rights, you have rights to all pqm managed branches.

Ah - sorry. I had my pubic location set to a lp: url, which I think
breaks. Will try agin.

On 02/08/2010 20:36, Bazaar Patch Queue Manager wrote:
>
> merge lp:~garyvdm/bzr/bzrw http://bazaar.launchpad.net/~bzr-pqm/bzr/2.2
> Command failed!
> running 0 tests...
>
> ----------------------------------------------------------------------
> Ran 0 tests in 0.002s
>
> OK
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxXHBQACgkQd/3EdwGKOh2pqwCcCe1o4ZTreS+ddUnOC4nNAsb7
mKUAnRQeVA/I+6ZsH26cnhsWAizRpkpf
=3pEh
-----END PGP SIGNATURE-----

Revision history for this message
Gary van der Merwe (garyvdm) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 02/08/2010 21:27, Gary van der Merwe wrote:
> On 02/08/2010 21:22, John Arbash Meinel wrote:
>> Gary van der Merwe wrote:
>>> I'll try submit to lp:bzr/2.2, but I think I might not have permissions to it.
>
>> I'm pretty sure we changed the submit rights so that if you *have*
>> rights, you have rights to all pqm managed branches.
>
> Ah - sorry. I had my pubic location set to a lp: url, which I think
> breaks. Will try agin.

Nope. That did not matter:

On 02/08/2010 21:30, Bazaar Patch Queue Manager wrote:
>
> merge http://bazaar.launchpad.net/~garyvdm/bzr/bzrw
http://bazaar.launchpad.net/~bzr-pqm/bzr/2.2
> Command failed!
> running 0 tests...
>
> ----------------------------------------------------------------------
> Ran 0 tests in 0.000s
>
> OK

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxXHPgACgkQd/3EdwGKOh2lfgCgtY0uhd21xzoT0nufh752KEBn
rLEAn0SeBopJQLLNKimmbN6v6usF6ULU
=L1N0
-----END PGP SIGNATURE-----

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'NEWS'
2--- NEWS 2010-07-29 06:45:20 +0000
3+++ NEWS 2010-08-02 19:59:41 +0000
4@@ -59,6 +59,10 @@
5 * Add ``bzrlib.merge.MergeIntoMerger``, which can merge part or all of a
6 tree, and works with unrelated branches. (Andrew Bennetts)
7
8+* Add py2exe windows target ``bzrw.exe``. This allow for starting a Bazaar
9+ GUI with out have a console open in the background.
10+ (Gary van der Merwe, #433781)
11+
12 Documentation
13 *************
14
15
16=== modified file 'setup.py'
17--- setup.py 2010-07-26 10:15:32 +0000
18+++ setup.py 2010-08-02 19:59:41 +0000
19@@ -9,6 +9,7 @@
20 import os
21 import os.path
22 import sys
23+import copy
24
25 if sys.version_info < (2, 4):
26 sys.stderr.write("[ERROR] Not a supported Python version. Need 2.4+\n")
27@@ -557,6 +558,8 @@
28 company_name = "Canonical Ltd.",
29 comments = META_INFO['description'],
30 )
31+ gui_target = copy.copy(target)
32+ gui_target.dest_base = "bzrw"
33
34 packages = BZRLIB['packages']
35 packages.remove('bzrlib')
36@@ -647,7 +650,7 @@
37 console_targets = [target,
38 'tools/win32/bzr_postinstall.py',
39 ]
40- gui_targets = []
41+ gui_targets = [gui_target]
42 data_files = topics_files + plugins_files
43
44 if 'qbzr' in plugins:
45@@ -692,6 +695,8 @@
46 "dll_excludes": dll_excludes,
47 "dist_dir": "win32_bzr.exe",
48 "optimize": 2,
49+ "custom_boot_script":
50+ "tools/win32/py2exe_boot_common.py",
51 },
52 }
53
54
55=== added file 'tools/win32/py2exe_boot_common.py'
56--- tools/win32/py2exe_boot_common.py 1970-01-01 00:00:00 +0000
57+++ tools/win32/py2exe_boot_common.py 2010-08-02 19:59:41 +0000
58@@ -0,0 +1,35 @@
59+# Common py2exe boot script - executed for all target types.
60+
61+# In the standard py2exe boot script, it setup stderr so that anything written
62+# to it will be written to exe.log, and a message dialog is shown.
63+# For Bazaar, we log most things to .bzr.log, and there are many things that
64+# write to stderr, that are not errors, and so we don't want the py2exe dialog
65+# message, So also blackhole stderr.
66+
67+import sys
68+if sys.frozen == "windows_exe":
69+
70+ class Blackhole(object):
71+ softspace = 0
72+ def write(self, text):
73+ pass
74+ def flush(self):
75+ pass
76+ sys.stdout = Blackhole()
77+ sys.stderr = Blackhole()
78+ del Blackhole
79+del sys
80+
81+# Disable linecache.getline() which is called by
82+# traceback.extract_stack() when an exception occurs to try and read
83+# the filenames embedded in the packaged python code. This is really
84+# annoying on windows when the d: or e: on our build box refers to
85+# someone elses removable or network drive so the getline() call
86+# causes it to ask them to insert a disk in that drive.
87+import linecache
88+def fake_getline(filename, lineno, module_globals=None):
89+ return ''
90+linecache.orig_getline = linecache.getline
91+linecache.getline = fake_getline
92+
93+del linecache, fake_getline

Subscribers

People subscribed via source and target branches