Rev 3433: review feedback from Ian in http://bzr.arbash-meinel.com/branches/bzr/1.6-dev/missing

John Arbash Meinel john at arbash-meinel.com
Tue May 20 03:34:13 BST 2008


At http://bzr.arbash-meinel.com/branches/bzr/1.6-dev/missing

------------------------------------------------------------
revno: 3433
revision-id: john at arbash-meinel.com-20080520023401-42mkw5g7dhq9f5bh
parent: john at arbash-meinel.com-20080519214725-z6g0mq5tsibsbrfj
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: missing
timestamp: Mon 2008-05-19 21:34:01 -0500
message:
  review feedback from Ian
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/missing.py              missing.py-20050812153334-097f7097e2a8bcd1
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS	2008-05-19 21:47:25 +0000
+++ b/NEWS	2008-05-20 02:34:01 +0000
@@ -16,12 +16,12 @@
 
   IMPROVEMENTS:
 
-  BUGFIXES:
-
     * ``bzr missing`` uses the new ``Graph.find_unique_ancestors`` and
       ``Graph.find_differences`` to determine missing revisions without having
       to search the whole ancestry. (John Arbash Meinel, #174625)
 
+  BUGFIXES:
+
   DOCUMENTATION:
 
   TESTING:

=== modified file 'bzrlib/missing.py'
--- a/bzrlib/missing.py	2008-05-19 21:35:52 +0000
+++ b/bzrlib/missing.py	2008-05-20 02:34:01 +0000
@@ -43,6 +43,19 @@
 
 
 def find_unmerged(local_branch, remote_branch, restrict='all'):
+    """Find revisions from each side that have not been merged.
+
+    :param local_branch: Compare the history of local_branch
+    :param remote_branch: versus the history of remote_branch, and determine
+        mainline revisions which have not been merged.
+    :param restrict: ('all', 'local', 'remote') If 'all', we will return the
+        unique revisions from both sides. If 'local', we will return None
+        for the remote revisions, similarly if 'remote' we will return None for
+        the local revisions.
+
+    :return: A list of [(revno, revision_id)] for the mainline revisions on
+        each side.
+    """
     local_branch.lock_read()
     try:
         remote_branch.lock_read()
@@ -61,9 +74,9 @@
     :param ancestry: A set of revisions that we care about
     :param graph: A Graph which lets us find the parents for a revision
     :param tip_revno: The revision number for the tip revision
-    :param tip: The tip of mailine
+    :param tip: The tip of mainline
     :return: [(revno, revision_id)] for all revisions in ancestry that
-        left-hand parents from tip
+        are left-hand parents from tip, or None if ancestry is None.
     """
     if ancestry is None:
         return None
@@ -90,28 +103,17 @@
 
 
 def _find_unmerged(local_branch, remote_branch, restrict):
-    """Find revisions from each side that have not been merged.
-
-    Both branches should already be locked.
-
-    :param local_branch: Compare the history of local_branch
-    :param remote_branch: versus the history of remote_branch, and determine
-        mainline revisions which have not been merged.
-    :param restrict: ('all', 'local', 'remote') If 'all', we will return the
-        unique revisions from both sides. If 'local', we will return None
-        for the remote revisions, similarly if 'remote' we will return None for
-        the local revisions.
-
-    :return: A list of [(revno, revision_id)] for the mainline revisions on
-        each side.
+    """See find_unmerged.
+
+    The branches should already be locked before entering.
     """
-    graph = local_branch.repository.get_graph(
-                remote_branch.repository)
     local_revno, local_revision_id = local_branch.last_revision_info()
     remote_revno, remote_revision_id = remote_branch.last_revision_info()
     if local_revno == remote_revno and local_revision_id == remote_revision_id:
         # A simple shortcut when the tips are at the same point
         return [], []
+    graph = local_branch.repository.get_graph(
+                remote_branch.repository)
     if restrict == 'remote':
         local_extra = None
         remote_extra = graph.find_unique_ancestors(



More information about the bazaar-commits mailing list