Rev 3230: (bialix) BZR_LOG env. variable controls location of .bzr.log in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Sat Feb 23 12:11:05 GMT 2008


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 3230
revision-id:pqm at pqm.ubuntu.com-20080223121051-ntecw60563jadb3s
parent: pqm at pqm.ubuntu.com-20080222065317-v0xvap07o35t0ymj
parent: bialix at ukr.net-20080223102409-1hx325d2zvjwgmy4
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Sat 2008-02-23 12:10:51 +0000
message:
  (bialix) BZR_LOG env. variable controls location of .bzr.log
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/help_topics/__init__.py help_topics.py-20060920210027-rnim90q9e0bwxvy4-1
  bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
  bzrlib/tests/blackbox/test_version.py test_version.py-20070312060045-ol7th9z035r3im3d-1
  bzrlib/trace.py                trace.py-20050309040759-c8ed824bdcd4748a
    ------------------------------------------------------------
    revno: 3193.6.9
    revision-id:bialix at ukr.net-20080223102409-1hx325d2zvjwgmy4
    parent: bialix at ukr.net-20080216100317-xg1hdw306evlgt94
    parent: pqm at pqm.ubuntu.com-20080222065317-v0xvap07o35t0ymj
    committer: Alexander Belchenko <bialix at ukr.net>
    branch nick: disable.bzr.log
    timestamp: Sat 2008-02-23 12:24:09 +0200
    message:
      merge bzr.dev
    added:
      doc/developers/development-repo.txt developmentrepo.txt-20080102200205-raj42k61dch8pjmj-1
    modified:
      .bzrignore                     bzrignore-20050311232317-81f7b71efa2db11a
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
      bzrlib/info.py                 info.py-20050323235939-6bbfe7d9700b0b9b
      bzrlib/remote.py               remote.py-20060720103555-yeeg2x51vn0rbtdp-1
      bzrlib/repofmt/knitrepo.py     knitrepo.py-20070206081537-pyy4a00xdas0j4pf-1
      bzrlib/repofmt/pack_repo.py    pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
      bzrlib/repofmt/weaverepo.py    presplitout.py-20070125045333-wfav3tsh73oxu3zk-1
      bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
      bzrlib/smart/bzrdir.py         bzrdir.py-20061122024551-ol0l0o0oofsu9b3t-1
      bzrlib/smart/request.py        request.py-20061108095550-gunadhxmzkdjfeek-1
      bzrlib/tests/repository_implementations/test_repository.py test_repository.py-20060131092128-ad07f494f5c9d26c
      bzrlib/tests/test_bzrdir.py    test_bzrdir.py-20060131065654-deba40eef51cf220
      bzrlib/tests/test_info.py      test_info.py-20070320150933-m0xxm1g7xi9v6noe-1
      bzrlib/tests/test_remote.py    test_remote.py-20060720103555-yeeg2x51vn0rbtdp-2
      bzrlib/tests/test_repository.py test_repository.py-20060131075918-65c555b881612f4d
      bzrlib/tests/test_smart.py     test_smart.py-20061122024551-ol0l0o0oofsu9b3t-2
      bzrlib/tests/test_transform.py test_transaction.py-20060105172520-b3ffb3946550e6c4
      bzrlib/transform.py            transform.py-20060105172343-dd99e54394d91687
      setup.py                       setup.py-20050314065409-02f8a0a6e3f9bc70
    ------------------------------------------------------------
    revno: 3193.6.8
    revision-id:bialix at ukr.net-20080216100317-xg1hdw306evlgt94
    parent: bialix at ukr.net-20080207084727-2eis03c4f2zf9inw
    parent: pqm at pqm.ubuntu.com-20080213062701-74mocrhfz0n4uj4r
    committer: Alexander Belchenko <bialix at ukr.net>
    branch nick: disable.bzr.log
    timestamp: Sat 2008-02-16 12:03:17 +0200
    message:
      merge bzr.dev; update for 1.3; $BZR_LOG used in trace.py module (again), not in the main bzr script (req. by Robert Collins)
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzr                            bzr.py-20050313053754-5485f144c7006fa6
      bzrlib/__init__.py             __init__.py-20050309040759-33e65acf91bbcd5d
      bzrlib/branch.py               branch.py-20050309040759-e4baf4e0d046576e
      bzrlib/bundle/commands.py      __init__.py-20050617152058-1b6530d9ab85c11c
      bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
      bzrlib/dirstate.py             dirstate.py-20060728012006-d6mvoihjb3je9peu-1
      bzrlib/errors.py               errors.py-20050309040759-20512168c4e14fbd
      bzrlib/graph.py                graph_walker.py-20070525030359-y852guab65d4wtn0-1
      bzrlib/knit.py                 knit.py-20051212171256-f056ac8f0fbe1bd9
      bzrlib/plugins/launchpad/__init__.py __init__.py-20060315182712-2d5feebd2a1032dc
      bzrlib/plugins/launchpad/lp_indirect.py lp_indirect.py-20070126012204-de5rugwlt22c7u7e-1
      bzrlib/plugins/launchpad/lp_registration.py lp_registration.py-20060315190948-daa617eafe3a8d48
      bzrlib/plugins/launchpad/test_lp_indirect.py test_lp_indirect.py-20070126002743-oyle362tzv9cd8mi-1
      bzrlib/progress.py             progress.py-20050610070202-df9faaab791964c0
      bzrlib/remote.py               remote.py-20060720103555-yeeg2x51vn0rbtdp-1
      bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
      bzrlib/smart/medium.py         medium.py-20061103051856-rgu2huy59fkz902q-1
      bzrlib/smart/protocol.py       protocol.py-20061108035435-ot0lstk2590yqhzr-1
      bzrlib/smart/repository.py     repository.py-20061128022038-vr5wy5bubyb8xttk-1
      bzrlib/symbol_versioning.py    symbol_versioning.py-20060105104851-9ecf8af605d15a80
      bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
      bzrlib/tests/blackbox/test_bundle_info.py test_bundle_info.py-20070816181255-eiuodwxuqu7w7gxf-1
      bzrlib/tests/blackbox/test_version_info.py test_bb_version_info.py-20051228204928-91711c6559d952f7
      bzrlib/tests/test_dirstate.py  test_dirstate.py-20060728012006-d6mvoihjb3je9peu-2
      bzrlib/tests/test_errors.py    test_errors.py-20060210110251-41aba2deddf936a8
      bzrlib/tests/test_progress.py  test_progress.py-20060308160359-978c397bc79b7fda
      bzrlib/tests/test_remote.py    test_remote.py-20060720103555-yeeg2x51vn0rbtdp-2
      bzrlib/tests/test_revisionnamespaces.py testrevisionnamespaces.py-20050711050225-8b4af89e6b1efe84
      bzrlib/tests/test_smart.py     test_smart.py-20061122024551-ol0l0o0oofsu9b3t-2
      bzrlib/tests/test_trace.py     testtrace.py-20051110225523-a21117fc7a07eeff
      bzrlib/tests/test_version_info.py test_version_info.py-20051228204928-2c364e30b702b41b
      bzrlib/tests/test_workingtree_4.py test_workingtree_4.p-20070223025758-531n3tznl3zacv2o-1
      bzrlib/trace.py                trace.py-20050309040759-c8ed824bdcd4748a
      bzrlib/version_info_formats/format_custom.py format_custom.py-20071029100350-ajovqhbpb5khf6gu-1
      bzrlib/workingtree_4.py        workingtree_4.py-20070208044105-5fgpc5j3ljlh5q6c-1
    ------------------------------------------------------------
    revno: 3193.6.7
    revision-id:bialix at ukr.net-20080207084727-2eis03c4f2zf9inw
    parent: bialix at ukr.net-20080206100717-wnixj1s8u2fks08r
    committer: Alexander Belchenko <bialix at ukr.net>
    branch nick: disable.bzr.log
    timestamp: Thu 2008-02-07 10:47:27 +0200
    message:
      If BZR_HOME environment variable is defined then default location for .bzr.log trace file is ``$BZR_HOME/.bzr.log`` (required for proper testing BZR_LOG environment variable).
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/tests/blackbox/test_version.py test_version.py-20070312060045-ol7th9z035r3im3d-1
      bzrlib/trace.py                trace.py-20050309040759-c8ed824bdcd4748a
    ------------------------------------------------------------
    revno: 3193.6.6
    revision-id:bialix at ukr.net-20080206100717-wnixj1s8u2fks08r
    parent: bialix at ukr.net-20080206100501-2krf98tgske339aw
    parent: pqm at pqm.ubuntu.com-20080201053934-q32y2nk5vvo13c6v
    committer: Alexander Belchenko <bialix at ukr.net>
    branch nick: disable.bzr.log
    timestamp: Wed 2008-02-06 12:07:17 +0200
    message:
      merge bzr.dev
    removed:
      bzrlib/plugins/multiparent.py  mpregen-20070411063203-5x9z7i73add0d6f6-1
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/annotate.py             annotate.py-20050922133147-7c60541d2614f022
      bzrlib/branch.py               branch.py-20050309040759-e4baf4e0d046576e
      bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
      bzrlib/delta.py                delta.py-20050729221636-54cf14ef94783d0a
      bzrlib/errors.py               errors.py-20050309040759-20512168c4e14fbd
      bzrlib/graph.py                graph_walker.py-20070525030359-y852guab65d4wtn0-1
      bzrlib/help_topics/__init__.py help_topics.py-20060920210027-rnim90q9e0bwxvy4-1
      bzrlib/inventory.py            inventory.py-20050309040759-6648b84ca2005b37
      bzrlib/knit.py                 knit.py-20051212171256-f056ac8f0fbe1bd9
      bzrlib/merge.py                merge.py-20050513021216-953b65a438527106
      bzrlib/osutils.py              osutils.py-20050309040759-eeaff12fbf77ac86
      bzrlib/plugins/launchpad/__init__.py __init__.py-20060315182712-2d5feebd2a1032dc
      bzrlib/plugins/launchpad/lp_registration.py lp_registration.py-20060315190948-daa617eafe3a8d48
      bzrlib/plugins/launchpad/test_register.py test_register.py-20060315182712-40f5dda945c829a8
      bzrlib/remote.py               remote.py-20060720103555-yeeg2x51vn0rbtdp-1
      bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
      bzrlib/status.py               status.py-20050505062338-431bfa63ec9b19e6
      bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
      bzrlib/tests/blackbox/test_outside_wt.py test_outside_wt.py-20060116200058-98edd33e7db8bdde
      bzrlib/tests/blackbox/test_pull.py test_pull.py-20051201144907-64959364f629947f
      bzrlib/tests/repository_implementations/test_repository.py test_repository.py-20060131092128-ad07f494f5c9d26c
      bzrlib/tests/test_diff.py      testdiff.py-20050727164403-d1a3496ebb12e339
      bzrlib/tests/test_errors.py    test_errors.py-20060210110251-41aba2deddf936a8
      bzrlib/tests/test_http.py      testhttp.py-20051018020158-b2eef6e867c514d9
      bzrlib/tests/test_merge.py     testmerge.py-20050905070950-c1b5aa49ff911024
      bzrlib/tests/test_nonascii.py  testnonascii.py-20051018022645-ea1d8b6477b058a6
      bzrlib/tests/test_selftest.py  test_selftest.py-20051202044319-c110a115d8c0456a
      bzrlib/tests/test_transform.py test_transaction.py-20060105172520-b3ffb3946550e6c4
      bzrlib/tests/workingtree_implementations/test_rename_one.py test_rename_one.py-20070226161242-2d8ibdedl700jgio-1
      bzrlib/transform.py            transform.py-20060105172343-dd99e54394d91687
    ------------------------------------------------------------
    revno: 3193.6.5
    revision-id:bialix at ukr.net-20080206100501-2krf98tgske339aw
    parent: bialix at ukr.net-20080206100156-wpsmtdnf9x8pn79c
    committer: Alexander Belchenko <bialix at ukr.net>
    branch nick: disable.bzr.log
    timestamp: Wed 2008-02-06 12:05:01 +0200
    message:
      help topic on $BZR_LOG differentiate between *nix and Win32
    modified:
      bzrlib/help_topics/__init__.py help_topics.py-20060920210027-rnim90q9e0bwxvy4-1
    ------------------------------------------------------------
    revno: 3193.6.4
    revision-id:bialix at ukr.net-20080206100156-wpsmtdnf9x8pn79c
    parent: bialix at ukr.net-20080128224819-88buaniv5dwy9vx4
    committer: Alexander Belchenko <bialix at ukr.net>
    branch nick: disable.bzr.log
    timestamp: Wed 2008-02-06 12:01:56 +0200
    message:
      blackbox tests for `bzr version` command output to check $BZR_LOG effect
    modified:
      bzrlib/tests/blackbox/test_version.py test_version.py-20070312060045-ol7th9z035r3im3d-1
      bzrlib/trace.py                trace.py-20050309040759-c8ed824bdcd4748a
    ------------------------------------------------------------
    revno: 3193.6.3
    revision-id:bialix at ukr.net-20080128224819-88buaniv5dwy9vx4
    parent: bialix at ukr.net-20080128222213-gitken71eyvdd203
    committer: Alexander Belchenko <bialix at ukr.net>
    branch nick: disable.bzr.log
    timestamp: Tue 2008-01-29 00:48:19 +0200
    message:
      $BZR_LOG is used to contol location of .bzr.log (use /dev/null or NUL to suppress log).
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzr                            bzr.py-20050313053754-5485f144c7006fa6
      bzrlib/help_topics/__init__.py help_topics.py-20060920210027-rnim90q9e0bwxvy4-1
      bzrlib/trace.py                trace.py-20050309040759-c8ed824bdcd4748a
    ------------------------------------------------------------
    revno: 3193.6.2
    revision-id:bialix at ukr.net-20080128222213-gitken71eyvdd203
    parent: bialix at ukr.net-20080128084024-i01fle19i8ij3p9t
    parent: pqm at pqm.ubuntu.com-20080125195940-iwy2onaiiges6k4t
    committer: Alexander Belchenko <bialix at ukr.net>
    branch nick: disable.bzr.log
    timestamp: Tue 2008-01-29 00:22:13 +0200
    message:
      merge bzr.dev
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/__init__.py             __init__.py-20050309040759-33e65acf91bbcd5d
      bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
      bzrlib/commands.py             bzr.py-20050309040720-d10f4714595cf8c3
      bzrlib/debug.py                debug.py-20061102062349-vdhrw9qdpck8cl35-1
      bzrlib/doc/api/__init__.py     __init__.py-20051224020744-7b87d590843855bc
      bzrlib/help_topics/__init__.py help_topics.py-20060920210027-rnim90q9e0bwxvy4-1
      bzrlib/plugin.py               plugin.py-20050622060424-829b654519533d69
      bzrlib/reconfigure.py          reconfigure.py-20070908040425-6ykgo7escxhyrg9p-1
      bzrlib/smart/client.py         client.py-20061116014825-2k6ada6xgulslami-1
      bzrlib/smart/medium.py         medium.py-20061103051856-rgu2huy59fkz902q-1
      bzrlib/smart/protocol.py       protocol.py-20061108035435-ot0lstk2590yqhzr-1
      bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
      bzrlib/tests/blackbox/test_selftest.py test_selftest.py-20060123024542-01c5f1bbcb596d78
      bzrlib/tests/test_osutils.py   test_osutils.py-20051201224856-e48ee24c12182989
      bzrlib/tests/test_plugins.py   plugins.py-20050622075746-32002b55e5e943e9
      bzrlib/tests/test_reconfigure.py test_reconfigure.py-20070908040425-6ykgo7escxhyrg9p-2
      bzrlib/tests/test_remote.py    test_remote.py-20060720103555-yeeg2x51vn0rbtdp-2
      bzrlib/tests/test_selftest.py  test_selftest.py-20051202044319-c110a115d8c0456a
      bzrlib/tests/test_smart_transport.py test_ssh_transport.py-20060608202016-c25gvf1ob7ypbus6-2
      bzrlib/tests/test_trace.py     testtrace.py-20051110225523-a21117fc7a07eeff
      bzrlib/trace.py                trace.py-20050309040759-c8ed824bdcd4748a
    ------------------------------------------------------------
    revno: 3193.6.1
    revision-id:bialix at ukr.net-20080128084024-i01fle19i8ij3p9t
    parent: pqm at pqm.ubuntu.com-20080118055224-sskoia4bcpxd8wzu
    committer: Alexander Belchenko <bialix at ukr.net>
    branch nick: disable.bzr.log
    timestamp: Mon 2008-01-28 10:40:24 +0200
    message:
      ``BZR_LOG=disable`` suppresses writing messages to .bzr.log.
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/help_topics/__init__.py help_topics.py-20060920210027-rnim90q9e0bwxvy4-1
      bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
      bzrlib/trace.py                trace.py-20050309040759-c8ed824bdcd4748a
=== modified file 'NEWS'
--- a/NEWS	2008-02-22 01:16:19 +0000
+++ b/NEWS	2008-02-23 10:24:09 +0000
@@ -11,11 +11,18 @@
   
   CHANGES:
 
-   * A new repository format 'development' has been added. This format will
-     represent the latest 'in-progress' format that the bzr developers are
-     interested in getting early-adopter testing and feedback on.
-     ``doc/developers/development-repo.txt`` has detailed information.
-     (Robert Collins)
+    * A new repository format 'development' has been added. This format will
+      represent the latest 'in-progress' format that the bzr developers are
+      interested in getting early-adopter testing and feedback on.
+      ``doc/developers/development-repo.txt`` has detailed information.
+      (Robert Collins)
+
+    * BZR_LOG environment variable controls location of .bzr.log trace file. 
+      User can suppress writing messages to .bzr.log by using '/dev/null'
+      filename (on Linux) or 'NUL' (on Windows). If BZR_LOG variable 
+      is not defined but BZR_HOME is defined then default location
+      for .bzr.log trace file is ``$BZR_HOME/.bzr.log``.
+      (Alexander Belchenko)
 
   FEATURES:
 

=== modified file 'bzrlib/help_topics/__init__.py'
--- a/bzrlib/help_topics/__init__.py	2008-01-28 22:13:31 +0000
+++ b/bzrlib/help_topics/__init__.py	2008-02-06 10:07:17 +0000
@@ -545,6 +545,8 @@
 BZR_HOME (Win32) Directory holding bazaar config dir. Overrides APPDATA and HOME.
 BZR_REMOTE_PATH  Full name of remote 'bzr' command (for bzr+ssh:// URLs).
 BZR_SSH          SSH client: paramiko (default), openssh, ssh, plink.
+BZR_LOG          Location of .bzr.log (use '/dev/null' to suppress log).
+BZR_LOG (Win32)  Location of .bzr.log (use 'NUL' to suppress log).
 ================ =================================================================
 """
 

=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py	2008-02-06 00:41:04 +0000
+++ b/bzrlib/tests/__init__.py	2008-02-16 10:03:17 +0000
@@ -1227,6 +1227,7 @@
             'BZREMAIL': None, # may still be present in the environment
             'EMAIL': None,
             'BZR_PROGRESS_BAR': None,
+            'BZR_LOG': None,
             # SSH Agent
             'SSH_AUTH_SOCK': None,
             # Proxies

=== modified file 'bzrlib/tests/blackbox/test_version.py'
--- a/bzrlib/tests/blackbox/test_version.py	2007-09-04 11:00:30 +0000
+++ b/bzrlib/tests/blackbox/test_version.py	2008-02-07 08:47:27 +0000
@@ -16,6 +16,9 @@
 
 """Black-box tests for bzr version."""
 
+import os
+import sys
+
 import bzrlib
 from bzrlib import osutils, trace
 from bzrlib.tests import (
@@ -36,7 +39,7 @@
         self.assertContainsRe(out, r"(?m)^  Python standard library:")
         self.assertContainsRe(out, r"(?m)^  bzrlib:")
         self.assertContainsRe(out, r"(?m)^  Bazaar configuration:")
-        self.assertContainsRe(out, r'(?m)^  Bazaar log file:.*bzr\.log')
+        self.assertContainsRe(out, r'(?m)^  Bazaar log file:.*\.bzr\.log')
 
 
 class TestVersionUnicodeOutput(TestCaseInTempDir):
@@ -74,3 +77,30 @@
         out = self.run_bzr("version")[0]
         self.assertTrue(len(out) > 0)
         self.assertContainsRe(out, r"(?m)^  Bazaar configuration: " + str_val)
+
+
+class TestVersionBzrLogLocation(TestCaseInTempDir):
+
+    def test_simple(self):
+        bzr_log = 'my.bzr.log'
+        osutils.set_or_unset_env('BZR_LOG', bzr_log)
+        default_log = os.path.join(os.environ['BZR_HOME'], '.bzr.log')
+        self.failIfExists([default_log, bzr_log])
+        out = self.run_bzr_subprocess('version')[0]
+        self.assertTrue(len(out) > 0)
+        self.assertContainsRe(out, r"(?m)^  Bazaar log file: " + bzr_log)
+        self.failIfExists(default_log)
+        self.failUnlessExists(bzr_log)
+
+    def test_dev_null(self):
+        if sys.platform == 'win32':
+            bzr_log = 'NUL'
+        else:
+            bzr_log = '/dev/null'
+        osutils.set_or_unset_env('BZR_LOG', bzr_log)
+        default_log = os.path.join(os.environ['BZR_HOME'], '.bzr.log')
+        self.failIfExists(default_log)
+        out = self.run_bzr_subprocess('version')[0]
+        self.assertTrue(len(out) > 0)
+        self.assertContainsRe(out, r"(?m)^  Bazaar log file: " + bzr_log)
+        self.failIfExists(default_log)

=== modified file 'bzrlib/trace.py'
--- a/bzrlib/trace.py	2008-02-06 00:41:04 +0000
+++ b/bzrlib/trace.py	2008-02-16 10:03:17 +0000
@@ -187,12 +187,16 @@
 
 
 def _get_bzr_log_filename():
-    # TODO: should this be overridden by $BZR_HOME?
-    if sys.platform == 'win32':
-        from bzrlib import win32utils
-        home = win32utils.get_home_location()
-    else:
-        home = os.path.expanduser('~')
+    bzr_log = os.environ.get('BZR_LOG')
+    if bzr_log:
+        return bzr_log
+    home = os.environ.get('BZR_HOME')
+    if home is None:
+        if sys.platform == 'win32':
+            from bzrlib import win32utils
+            home = win32utils.get_home_location()
+        else:
+            home = os.path.expanduser('~')
     return os.path.join(home, '.bzr.log')
 
 




More information about the bazaar-commits mailing list