Rev 2467: Remove exploratory cruft. in file:///home/robertc/source/baz/dirstate/

Robert Collins robertc at robertcollins.net
Thu Mar 1 05:46:32 GMT 2007


At file:///home/robertc/source/baz/dirstate/

------------------------------------------------------------
revno: 2467
revision-id: robertc at robertcollins.net-20070301054630-ff4zf6s3odxfic71
parent: robertc at robertcollins.net-20070301053439-rf8mkppoqutiy7fa
committer: Robert Collins <robertc at robertcollins.net>
branch nick: dirstate
timestamp: Thu 2007-03-01 16:46:30 +1100
message:
  Remove exploratory cruft.
modified:
  bzrlib/tree.py                 tree.py-20050309040759-9d5f2496be663e77
=== modified file 'bzrlib/tree.py'
--- a/bzrlib/tree.py	2007-03-01 00:47:45 +0000
+++ b/bzrlib/tree.py	2007-03-01 05:46:30 +0000
@@ -453,58 +453,6 @@
     specified_path_ids = _find_ids_across_trees(filenames, trees,
         require_versioned)
     return _find_children_across_trees(specified_path_ids, trees)
-#    specified_ids = [id for path, id in _find_path_ids_across_trees(filenames, trees, require_versioned)]
-#    return _find_children_across_trees(specified_ids, trees)
-
-def find_path_ids_across_trees(filenames, trees, require_versioned=True):
-    """Find the paths and ids corresponding to specified filenames.
-    
-    All matches in all trees will be used, and all children of matched
-    directories will be included
-
-    :param filenames: The filenames to find file_ids for
-    :param trees: The trees to find file_ids within
-    :param require_versioned: if true, all specified filenames must occur in
-        at least one tree.
-    :return: a set of (path, file ids) for the specified filenames and their
-        children. The returned path is the path of the id in the first tree
-        that contains it. This matters when files have been moved 
-    """
-    if not filenames:
-        return set()
-    # This function needs to know the ids for filenames in all trees, then
-    # search for those same files and children in all the other trees.
-    # it is complicated by the same path in two trees being able to have
-    # different ids, which might both be present in both trees.
-    # consider two trees, which have had 'mv foo bar' and 'mv baz foo' done
-    # in this case, a diff of 'foo' should should changes to both the current
-    # 'bar' and the current 'foo' which was baz. Its arguable that if 
-    # the situation is 'mv parent/foo bar' and 'mv baz parent/foo', that 
-    # we should return the current bar and the current parent/foo' - at the 
-    # moment we do, but we loop around all ids and all trees: I*T checks.
-    
-    # Updating this algorithm to be fast in the common case:
-    # nothing has moved, all files have the same id in parent, child and there
-    # are only two trees (or one is working tree and the others are parents).
-    # walk the dirstate. as we find each path, gather the paths of that
-    # id in all trees. add a mapping from the id to the path in those trees.
-    # now lookup children by id, again in all trees; for these trees that
-    # nothing has moved in, the id->path mapping will allow us to find the
-    # parent trivially. To answer 'has anything been moved' in one of the
-    # dirstate parent trees though, we will need to stare harder at it.
-
-    #  Now, given a path index, that is trivial for any one tree, and given
-    #  that we can ask for additional data from a dirstate tree, its a single
-    #  pass, though it will require scanning the entire tree to find paths
-    #  that were at the current location.
-    # ideal results?: There are three things: tree, path, id. Pathologically
-    # we can have completely disjoint ids for each tree; but we cannot have 
-    # disjoin paths for each tree, except if we scan each tree for the 
-    # different ids from other trees.
-
-    specified_path_ids = _find_ids_across_trees(filenames, trees,
-        require_versioned)
-    return _find_path_id_children_across_trees(specified_path_ids, trees)
 
 
 def _find_ids_across_trees(filenames, trees, require_versioned):



More information about the bazaar-commits mailing list