~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/graph.py

  • Committer: Vincent Ladeuil
  • Date: 2009-09-19 16:14:10 UTC
  • mto: (4707.2.1 integration)
  • mto: This revision was merged to the branch mainline in revision 4708.
  • Revision ID: v.ladeuil+lp@free.fr-20090919161410-lmlunl2q9kbzd3x0
Fix OSX and FreeBSD failures.

* bzrlib/tests/__init__.py:
(TestCaseWithMemoryTransport._make_test_root): Fixing the problem
at the root, if we usr the real path there, we catch 99% of the
consequences.

* bzrlib/tests/test_osutils.py:
(TestCanonicalRelPath.test_canonical_relpath_simple,
TestCanonicalRelPath.test_canonical_relpath_missing_tail): No need
to use realpath here anymore.

* bzrlib/tests/script.py:
(ScriptRunner.do_rm): OSX and BSD raises a different exception,
and windows too even if that will require real testing (but
osutils._delete_file_or_dir use the same trick for unlink so it's
a pretty safe bet).

* bzrlib/tests/blackbox/test_outside_wt.py:
(TestOutsideWT.test_cwd_log,
TestOutsideWT.test_diff_outside_tree): Watch for OSX trick.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007-2010 Canonical Ltd
 
1
# Copyright (C) 2007, 2008, 2009 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
1679
1679
    return result
1680
1680
 
1681
1681
 
1682
 
class GraphThunkIdsToKeys(object):
1683
 
    """Forwards calls about 'ids' to be about keys internally."""
1684
 
 
1685
 
    def __init__(self, graph):
1686
 
        self._graph = graph
1687
 
 
1688
 
    def topo_sort(self):
1689
 
        return [r for (r,) in self._graph.topo_sort()]
1690
 
 
1691
 
    def heads(self, ids):
1692
 
        """See Graph.heads()"""
1693
 
        as_keys = [(i,) for i in ids]
1694
 
        head_keys = self._graph.heads(as_keys)
1695
 
        return set([h[0] for h in head_keys])
1696
 
 
1697
 
    def merge_sort(self, tip_revision):
1698
 
        return self._graph.merge_sort((tip_revision,))
1699
 
 
1700
 
 
1701
1682
_counters = [0,0,0,0,0,0,0]
1702
1683
try:
1703
1684
    from bzrlib._known_graph_pyx import KnownGraph