Rev 4962: (mbp) better messages and help for lock contention and break-lock in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Fri Jan 15 02:59:55 GMT 2010


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

------------------------------------------------------------
revno: 4962 [merge]
revision-id: pqm at pqm.ubuntu.com-20100115025953-xsjlum93p1luvn2y
parent: pqm at pqm.ubuntu.com-20100114181258-ey8bgiolululzosu
parent: mbp at sourcefrog.net-20100115022849-32h4gvx73bjlavoo
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2010-01-15 02:59:53 +0000
message:
  (mbp) better messages and help for lock contention and break-lock
modified:
  bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
  bzrlib/lockdir.py              lockdir.py-20060220222025-98258adf27fbdda3
  bzrlib/tests/test_lockdir.py   test_lockdir.py-20060220222025-33d4221569a3d600
=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py	2010-01-13 23:26:10 +0000
+++ b/bzrlib/builtins.py	2010-01-15 02:28:49 +0000
@@ -4728,10 +4728,12 @@
     CAUTION: Locks should only be broken when you are sure that the process
     holding the lock has been stopped.
 
-    You can get information on what locks are open via the 'bzr info' command.
+    You can get information on what locks are open via the 'bzr info
+    [location]' command.
 
     :Examples:
         bzr break-lock
+        bzr break-lock bzr+ssh://example.com/bzr/foo
     """
     takes_args = ['location?']
 

=== modified file 'bzrlib/lockdir.py'
--- a/bzrlib/lockdir.py	2010-01-04 02:25:11 +0000
+++ b/bzrlib/lockdir.py	2010-01-15 02:27:31 +0000
@@ -534,19 +534,22 @@
                     deadline_str = time.strftime('%H:%M:%S',
                                                  time.localtime(deadline))
                 lock_url = self.transport.abspath(self.path)
+                # See <https://bugs.edge.launchpad.net/bzr/+bug/250451>
+                # the URL here is sometimes not one that is useful to the
+                # user, perhaps being wrapped in a lp-%d or chroot decorator,
+                # especially if this error is issued from the server.
                 self._report_function('%s %s\n'
-                                      '%s\n' # held by
-                                      '%s\n' # locked ... ago
-                                      'Will continue to try until %s, unless '
-                                      'you press Ctrl-C\n'
-                                      'If you\'re sure that it\'s not being '
-                                      'modified, use bzr break-lock %s',
-                                      start,
-                                      formatted_info[0],
-                                      formatted_info[1],
-                                      formatted_info[2],
-                                      deadline_str,
-                                      lock_url)
+                    '%s\n' # held by
+                    '%s\n' # locked ... ago
+                    'Will continue to try until %s, unless '
+                    'you press Ctrl-C.\n'
+                    'See "bzr help break-lock" for more.',
+                    start,
+                    formatted_info[0],
+                    formatted_info[1],
+                    formatted_info[2],
+                    deadline_str,
+                    )
 
             if (max_attempts is not None) and (attempt_count >= max_attempts):
                 self._trace("exceeded %d attempts")

=== modified file 'bzrlib/tests/test_lockdir.py'
--- a/bzrlib/tests/test_lockdir.py	2009-06-23 08:43:05 +0000
+++ b/bzrlib/tests/test_lockdir.py	2010-01-15 02:27:31 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2006, 2007, 2008 Canonical Ltd
+# Copyright (C) 2006, 2007, 2008, 2010 Canonical Ltd
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -197,9 +197,8 @@
         self.assertEqual('%s %s\n'
                          '%s\n%s\n'
                          'Will continue to try until %s, unless '
-                         'you press Ctrl-C\n'
-                         'If you\'re sure that it\'s not being '
-                         'modified, use bzr break-lock %s',
+                         'you press Ctrl-C.\n'
+                         'See "bzr help break-lock" for more.',
                          self._logged_reports[0][0])
         args = self._logged_reports[0][1]
         self.assertEqual('Unable to obtain', args[0])
@@ -420,9 +419,8 @@
         self.assertEqual('%s %s\n'
                          '%s\n%s\n'
                          'Will continue to try until %s, unless '
-                         'you press Ctrl-C\n'
-                         'If you\'re sure that it\'s not being '
-                         'modified, use bzr break-lock %s',
+                         'you press Ctrl-C.\n'
+                         'See "bzr help break-lock" for more.',
                          self._logged_reports[0][0])
         args = self._logged_reports[0][1]
         self.assertEqual('Unable to obtain', args[0])
@@ -435,9 +433,8 @@
         self.assertEqual('%s %s\n'
                          '%s\n%s\n'
                          'Will continue to try until %s, unless '
-                         'you press Ctrl-C\n'
-                         'If you\'re sure that it\'s not being '
-                         'modified, use bzr break-lock %s',
+                         'you press Ctrl-C.\n'
+                         'See "bzr help break-lock" for more.',
                          self._logged_reports[1][0])
         args = self._logged_reports[1][1]
         self.assertEqual('Lock owner changed for', args[0])




More information about the bazaar-commits mailing list