Rev 3265: Add 'kind' to UnknownFormatError (#173980, dwatkins) in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Wed Mar 12 02:46:49 GMT 2008


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

------------------------------------------------------------
revno: 3265
revision-id:pqm at pqm.ubuntu.com-20080312024638-d1zdt09upkzq52is
parent: pqm at pqm.ubuntu.com-20080311163301-ckw6hxe1rwahhgrt
parent: aaron at aaronbentley.com-20080312010603-051mk9j0i83elba4
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Wed 2008-03-12 02:46:38 +0000
message:
  Add 'kind' to UnknownFormatError (#173980, dwatkins)
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/branch.py               branch.py-20050309040759-e4baf4e0d046576e
  bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
  bzrlib/errors.py               errors.py-20050309040759-20512168c4e14fbd
  bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
  bzrlib/tests/test_errors.py    test_errors.py-20060210110251-41aba2deddf936a8
  bzrlib/workingtree.py          workingtree.py-20050511021032-29b6ec0a681e02e3
    ------------------------------------------------------------
    revno: 3144.3.8.1.4.1.3
    revision-id:aaron at aaronbentley.com-20080312010603-051mk9j0i83elba4
    parent: aaron at aaronbentley.com-20080311142930-wix505au2341po0s
    parent: d.m.watkins at warwick.ac.uk-20080303215319-2x3ysdzq5aqo3v3u
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: bzr.ab.integration
    timestamp: Tue 2008-03-11 21:06:03 -0400
    message:
      Merge from oddbloke
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/branch.py               branch.py-20050309040759-e4baf4e0d046576e
      bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
      bzrlib/errors.py               errors.py-20050309040759-20512168c4e14fbd
      bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
      bzrlib/tests/test_errors.py    test_errors.py-20060210110251-41aba2deddf936a8
      bzrlib/workingtree.py          workingtree.py-20050511021032-29b6ec0a681e02e3
    ------------------------------------------------------------
    revno: 3246.3.4
    revision-id:d.m.watkins at warwick.ac.uk-20080303215319-2x3ysdzq5aqo3v3u
    parent: d.m.watkins at warwick.ac.uk-20080303175012-wpkw0s3lht1ud28u
    committer: Daniel Watkins <D.M.Watkins at warwick.ac.uk>
    branch nick: 173980
    timestamp: Mon 2008-03-03 21:53:19 +0000
    message:
      Added test.
    modified:
      bzrlib/tests/test_errors.py    test_errors.py-20060210110251-41aba2deddf936a8
    ------------------------------------------------------------
    revno: 3246.3.3
    revision-id:d.m.watkins at warwick.ac.uk-20080303175012-wpkw0s3lht1ud28u
    parent: d.m.watkins at warwick.ac.uk-20080303174836-m8k7v7q55ftqwnzt
    committer: Daniel Watkins <D.M.Watkins at warwick.ac.uk>
    branch nick: 173980
    timestamp: Mon 2008-03-03 17:50:12 +0000
    message:
      Added NEWS entry.
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
    ------------------------------------------------------------
    revno: 3246.3.2
    revision-id:d.m.watkins at warwick.ac.uk-20080303174836-m8k7v7q55ftqwnzt
    parent: d.m.watkins at warwick.ac.uk-20080303174453-5wbemucwuc176emh
    committer: Daniel Watkins <D.M.Watkins at warwick.ac.uk>
    branch nick: 173980
    timestamp: Mon 2008-03-03 17:48:36 +0000
    message:
      Modified uses of errors.UnknownFormatError.
    modified:
      bzrlib/branch.py               branch.py-20050309040759-e4baf4e0d046576e
      bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
      bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
      bzrlib/workingtree.py          workingtree.py-20050511021032-29b6ec0a681e02e3
    ------------------------------------------------------------
    revno: 3246.3.1
    revision-id:d.m.watkins at warwick.ac.uk-20080303174453-5wbemucwuc176emh
    parent: pqm at pqm.ubuntu.com-20080229011300-p50it0si2y8mbv0d
    committer: Daniel Watkins <D.M.Watkins at warwick.ac.uk>
    branch nick: 173980
    timestamp: Mon 2008-03-03 17:44:53 +0000
    message:
      Modified UnknownFormatError to allow a kind to be specified.
    modified:
      bzrlib/errors.py               errors.py-20050309040759-20512168c4e14fbd
=== modified file 'NEWS'
--- a/NEWS	2008-03-10 23:39:45 +0000
+++ b/NEWS	2008-03-12 01:06:03 +0000
@@ -67,6 +67,9 @@
     * Redirecting the output from ``bzr merge`` (when the remembered
       location is used) now works. (John Arbash Meinel)
 
+    * UnknownFormatErrors no longer refer to branches regardless of kind of
+      unknown format. (Daniel Watkins, #173980)
+
     * Upgrade bundled ConfigObj to version 4.5.2, which properly quotes #
       signs, among other small improvements. (Matt Nordhoff, #86838)
 

=== modified file 'bzrlib/branch.py'
--- a/bzrlib/branch.py	2008-03-05 13:13:43 +0000
+++ b/bzrlib/branch.py	2008-03-12 01:06:03 +0000
@@ -834,7 +834,7 @@
         except errors.NoSuchFile:
             raise errors.NotBranchError(path=transport.base)
         except KeyError:
-            raise errors.UnknownFormatError(format=format_string)
+            raise errors.UnknownFormatError(format=format_string, kind='branch')
 
     @classmethod
     def get_default_format(klass):

=== modified file 'bzrlib/bzrdir.py'
--- a/bzrlib/bzrdir.py	2008-03-09 22:16:24 +0000
+++ b/bzrlib/bzrdir.py	2008-03-12 01:06:03 +0000
@@ -1436,7 +1436,7 @@
         try:
             return klass._formats[format_string]
         except KeyError:
-            raise errors.UnknownFormatError(format=format_string)
+            raise errors.UnknownFormatError(format=format_string, kind='bzrdir')
 
     @classmethod
     def get_default_format(klass):

=== modified file 'bzrlib/errors.py'
--- a/bzrlib/errors.py	2008-02-24 17:19:56 +0000
+++ b/bzrlib/errors.py	2008-03-03 17:44:53 +0000
@@ -684,7 +684,11 @@
 
 class UnknownFormatError(BzrError):
     
-    _fmt = "Unknown branch format: %(format)r"
+    _fmt = "Unknown %(kind)s format: %(format)r"
+
+    def __init__(self, format, kind='branch'):
+        self.kind = kind
+        self.format = format
 
 
 class IncompatibleFormat(BzrError):

=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py	2008-02-19 03:58:32 +0000
+++ b/bzrlib/repository.py	2008-03-03 17:48:36 +0000
@@ -2119,7 +2119,8 @@
         except errors.NoSuchFile:
             raise errors.NoRepositoryPresent(a_bzrdir)
         except KeyError:
-            raise errors.UnknownFormatError(format=format_string)
+            raise errors.UnknownFormatError(format=format_string,
+                                            kind='repository')
 
     @classmethod
     def register_format(klass, format):

=== modified file 'bzrlib/tests/test_errors.py'
--- a/bzrlib/tests/test_errors.py	2008-02-13 01:42:47 +0000
+++ b/bzrlib/tests/test_errors.py	2008-03-03 21:53:19 +0000
@@ -452,6 +452,10 @@
              "http://bug.com/"),
             str(err))
 
+    def test_unknown_format(self):
+        err = errors.UnknownFormatError('bar', kind='foo')
+        self.assertEquals("Unknown foo format: 'bar'", str(err))
+
 
 class PassThroughError(errors.BzrError):
     

=== modified file 'bzrlib/workingtree.py'
--- a/bzrlib/workingtree.py	2008-03-07 14:15:10 +0000
+++ b/bzrlib/workingtree.py	2008-03-12 01:06:03 +0000
@@ -2698,7 +2698,8 @@
         except errors.NoSuchFile:
             raise errors.NoWorkingTree(base=transport.base)
         except KeyError:
-            raise errors.UnknownFormatError(format=format_string)
+            raise errors.UnknownFormatError(format=format_string,
+                                            kind="working tree")
 
     def __eq__(self, other):
         return self.__class__ is other.__class__




More information about the bazaar-commits mailing list