[MERGE] trivial NotImplementedError and docstring tweaks

Andrew Bennetts andrew at puzzling.org
Thu Aug 17 04:52:32 BST 2006


On Thu, Aug 17, 2006 at 01:37:05PM +1000, Andrew Bennetts wrote:
> This patch mainly updates a bunch of NotImplementedErrors in bzrlib/branch.py
> from this style:

Obviously, it helps if I don't attach an empty file...

-Andrew.

-------------- next part --------------
=== modified file 'bzrlib/branch.py'
--- bzrlib/branch.py	2006-08-15 14:06:37 +0000
+++ bzrlib/branch.py	2006-08-17 03:26:10 +0000
@@ -158,23 +158,23 @@
     nick = property(_get_nick, _set_nick)
 
     def is_locked(self):
-        raise NotImplementedError('is_locked is abstract')
+        raise NotImplementedError(self.is_locked)
 
     def lock_write(self):
-        raise NotImplementedError('lock_write is abstract')
+        raise NotImplementedError(self.lock_write)
 
     def lock_read(self):
-        raise NotImplementedError('lock_read is abstract')
+        raise NotImplementedError(self.lock_read)
 
     def unlock(self):
-        raise NotImplementedError('unlock is abstract')
+        raise NotImplementedError(self.unlock)
 
     def peek_lock_mode(self):
         """Return lock mode for the Branch: 'r', 'w' or None"""
         raise NotImplementedError(self.peek_lock_mode)
 
     def get_physical_lock_status(self):
-        raise NotImplementedError('get_physical_lock_status is abstract')
+        raise NotImplementedError(self.get_physical_lock_status)
 
     def abspath(self, name):
         """Return absolute filename for something in the branch
@@ -182,7 +182,7 @@
         XXX: Robert Collins 20051017 what is this used for? why is it a branch
         method and not a tree method.
         """
-        raise NotImplementedError('abspath is abstract')
+        raise NotImplementedError(self.abspath)
 
     def bind(self, other):
         """Bind the local branch the other branch.
@@ -279,17 +279,17 @@
 
     def get_root_id(self):
         """Return the id of this branches root"""
-        raise NotImplementedError('get_root_id is abstract')
+        raise NotImplementedError(self.get_root_id)
 
     def print_file(self, file, revision_id):
         """Print `file` to stdout."""
-        raise NotImplementedError('print_file is abstract')
+        raise NotImplementedError(self.print_file)
 
     def append_revision(self, *revision_ids):
-        raise NotImplementedError('append_revision is abstract')
+        raise NotImplementedError(self.append_revision)
 
     def set_revision_history(self, rev_history):
-        raise NotImplementedError('set_revision_history is abstract')
+        raise NotImplementedError(self.set_revision_history)
 
     def revision_history(self):
         """Return sequence of revision hashes on to this branch."""
@@ -345,7 +345,7 @@
         :param stop_revision: Updated until the given revision
         :return: None
         """
-        raise NotImplementedError('update_revisions is abstract')
+        raise NotImplementedError(self.update_revisions)
 
     def revision_id_to_revno(self, revision_id):
         """Given a revision id, return its revno"""
@@ -368,7 +368,7 @@
         return history[revno - 1]
 
     def pull(self, source, overwrite=False, stop_revision=None):
-        raise NotImplementedError('pull is abstract')
+        raise NotImplementedError(self.pull)
 
     def basis_tree(self):
         """Return `Tree` object for last revision."""
@@ -379,7 +379,7 @@
 
         This can change the directory or the filename or both.
         """
-        raise NotImplementedError('rename_one is abstract')
+        raise NotImplementedError(self.rename_one)
 
     def move(self, from_paths, to_name):
         """Rename files.
@@ -395,7 +395,7 @@
         This returns a list of (from_path, to_path) pairs for each
         entry that is moved.
         """
-        raise NotImplementedError('move is abstract')
+        raise NotImplementedError(self.move)
 
     def get_parent(self):
         """Return the parent location of the branch.
@@ -404,7 +404,7 @@
         pattern is that the user can override it by specifying a
         location.
         """
-        raise NotImplementedError('get_parent is abstract')
+        raise NotImplementedError(self.get_parent)
 
     def get_submit_branch(self):
         """Return the submit location of the branch.
@@ -426,14 +426,14 @@
 
     def get_push_location(self):
         """Return the None or the location to push this branch to."""
-        raise NotImplementedError('get_push_location is abstract')
+        raise NotImplementedError(self.get_push_location)
 
     def set_push_location(self, location):
         """Set a new push location for this branch."""
-        raise NotImplementedError('set_push_location is abstract')
+        raise NotImplementedError(self.set_push_location)
 
     def set_parent(self, url):
-        raise NotImplementedError('set_parent is abstract')
+        raise NotImplementedError(self.set_parent)
 
     @needs_write_lock
     def update(self):

=== modified file 'bzrlib/transport/sftp.py'
--- bzrlib/transport/sftp.py	2006-07-31 23:04:57 +0000
+++ bzrlib/transport/sftp.py	2006-08-17 03:26:12 +0000
@@ -311,8 +311,8 @@
             pass
 
 
-class SFTPTransport (Transport):
-    """Transport implementation for SFTP access"""
+class SFTPTransport(Transport):
+    """Transport implementation for SFTP access."""
 
     _do_prefetch = _default_do_prefetch
     # TODO: jam 20060717 Conceivably these could be configurable, either



More information about the bazaar mailing list