Rev 5335: Use --config instead of --conf for break-lock. in file:///home/vila/src/bzr/bugs/525571-lock-bazaar-conf-files/

Vincent Ladeuil v.ladeuil+lp at free.fr
Fri Jul 2 16:15:43 BST 2010


At file:///home/vila/src/bzr/bugs/525571-lock-bazaar-conf-files/

------------------------------------------------------------
revno: 5335
revision-id: v.ladeuil+lp at free.fr-20100702151543-itx5rknlt6mirzzd
parent: v.ladeuil+lp at free.fr-20100702145058-jdy98i7fbb8ectcb
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: 525571-lock-bazaar-conf-files
timestamp: Fri 2010-07-02 17:15:43 +0200
message:
  Use --config instead of --conf for break-lock.
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS	2010-06-30 14:53:07 +0000
+++ b/NEWS	2010-07-02 15:15:43 +0000
@@ -36,7 +36,7 @@
 New Features
 ************
 
-* ``bzr break-lock --conf [location]`` can now break config files
+* ``bzr break-lock --config [location]`` can now break config files
   locks. (Vincent Ladeuil, #525571)
 
 * ``bzrlib.config.LockableConfig`` is a base class for config files that

=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py	2010-06-30 14:53:07 +0000
+++ b/bzrlib/builtins.py	2010-07-02 15:15:43 +0000
@@ -33,7 +33,7 @@
     bzrdir,
     directory_service,
     delta,
-    config,
+    config as _mod_config,
     errors,
     globbing,
     hooks,
@@ -3333,7 +3333,7 @@
                 try:
                     c = Branch.open_containing(u'.')[0].get_config()
                 except errors.NotBranchError:
-                    c = config.GlobalConfig()
+                    c = _mod_config.GlobalConfig()
             else:
                 c = Branch.open(directory).get_config()
             if email:
@@ -3344,7 +3344,7 @@
 
         # display a warning if an email address isn't included in the given name.
         try:
-            config.extract_email_address(name)
+            _mod_config.extract_email_address(name)
         except errors.NoEmailInUsername, e:
             warning('"%s" does not seem to contain an email address.  '
                     'This is allowed, but not recommended.', name)
@@ -3356,7 +3356,7 @@
             else:
                 c = Branch.open(directory).get_config()
         else:
-            c = config.GlobalConfig()
+            c = _mod_config.GlobalConfig()
         c.set_user_option('email', name)
 
 
@@ -3429,13 +3429,13 @@
                 'bzr alias --remove expects an alias to remove.')
         # If alias is not found, print something like:
         # unalias: foo: not found
-        c = config.GlobalConfig()
+        c = _mod_config.GlobalConfig()
         c.unset_alias(alias_name)
 
     @display_command
     def print_aliases(self):
         """Print out the defined aliases in a similar format to bash."""
-        aliases = config.GlobalConfig().get_aliases()
+        aliases = _mod_config.GlobalConfig().get_aliases()
         for key, value in sorted(aliases.iteritems()):
             self.outf.write('bzr alias %s="%s"\n' % (key, value))
 
@@ -3451,7 +3451,7 @@
 
     def set_alias(self, alias_name, alias_command):
         """Save the alias in the global config."""
-        c = config.GlobalConfig()
+        c = _mod_config.GlobalConfig()
         c.set_alias(alias_name, alias_command)
 
 
@@ -4849,16 +4849,16 @@
 
     takes_args = ['location?']
     takes_options = [
-        Option('conf',
+        Option('config',
                help='LOCATION is the directory where the config lock is.'),
         ]
 
-    def run(self, location=None, conf=False):
+    def run(self, location=None, config=False):
         if location is None:
             location = u'.'
-        if conf:
-            c = config.LockableConfig(lambda : location)
-            c.break_lock()
+        if config:
+            conf = _mod_config.LockableConfig(lambda : location)
+            conf.break_lock()
         else:
             control, relpath = bzrdir.BzrDir.open_containing(location)
             try:

=== modified file 'bzrlib/tests/blackbox/test_break_lock.py'
--- a/bzrlib/tests/blackbox/test_break_lock.py	2010-06-30 14:19:57 +0000
+++ b/bzrlib/tests/blackbox/test_break_lock.py	2010-07-02 15:15:43 +0000
@@ -121,7 +121,7 @@
 
     def test_break_lock(self):
         conf = self.create_pending_lock()
-        self.run_bzr('break-lock --conf %s'
+        self.run_bzr('break-lock --config %s'
                      % osutils.dirname(conf._get_filename()),
                      stdin="y\n")
         self.assertRaises(errors.LockBroken, conf.unlock)



More information about the bazaar-commits mailing list