/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: John Arbash Meinel
  • Date: 2006-07-11 15:05:36 UTC
  • mfrom: (1850 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1851.
  • Revision ID: john@arbash-meinel.com-20060711150536-a0dcb33b1581c044
NEWS about fixing #43689

Show diffs side-by-side

added added

removed removed

Lines of Context:
466
466
    def get_revision_graph(self, revision_id=None):
467
467
        """Return a dictionary containing the revision graph.
468
468
        
 
469
        :param revision_id: The revision_id to get a graph from. If None, then
 
470
        the entire revision graph is returned. This is a deprecated mode of
 
471
        operation and will be removed in the future.
469
472
        :return: a dictionary of revision_id->revision_parents_list.
470
473
        """
 
474
        # special case NULL_REVISION
 
475
        if revision_id == NULL_REVISION:
 
476
            return {}
471
477
        weave = self.get_inventory_weave()
472
478
        all_revisions = self._eliminate_revisions_not_present(weave.versions())
473
479
        entire_graph = dict([(node, weave.get_parents(node)) for 
501
507
            required = set([])
502
508
        else:
503
509
            pending = set(revision_ids)
504
 
            required = set(revision_ids)
 
510
            # special case NULL_REVISION
 
511
            if NULL_REVISION in pending:
 
512
                pending.remove(NULL_REVISION)
 
513
            required = set(pending)
505
514
        done = set([])
506
515
        while len(pending):
507
516
            revision_id = pending.pop()
873
882
    @needs_read_lock
874
883
    def get_revision_graph(self, revision_id=None):
875
884
        """Return a dictionary containing the revision graph.
876
 
        
 
885
 
 
886
        :param revision_id: The revision_id to get a graph from. If None, then
 
887
        the entire revision graph is returned. This is a deprecated mode of
 
888
        operation and will be removed in the future.
877
889
        :return: a dictionary of revision_id->revision_parents_list.
878
890
        """
 
891
        # special case NULL_REVISION
 
892
        if revision_id == NULL_REVISION:
 
893
            return {}
879
894
        weave = self._get_revision_vf()
880
895
        entire_graph = weave.get_graph()
881
896
        if revision_id is None:
909
924
            required = set([])
910
925
        else:
911
926
            pending = set(revision_ids)
912
 
            required = set(revision_ids)
 
927
            # special case NULL_REVISION
 
928
            if NULL_REVISION in pending:
 
929
                pending.remove(NULL_REVISION)
 
930
            required = set(pending)
913
931
        done = set([])
914
932
        while len(pending):
915
933
            revision_id = pending.pop()
2134
2152
        versionedfile.clear_cache()
2135
2153
 
2136
2154
 
2137
 
# Copied from xml.sax.saxutils
 
2155
_unescape_map = {
 
2156
    'apos':"'",
 
2157
    'quot':'"',
 
2158
    'amp':'&',
 
2159
    'lt':'<',
 
2160
    'gt':'>'
 
2161
}
 
2162
 
 
2163
 
 
2164
def _unescaper(match, _map=_unescape_map):
 
2165
    return _map[match.group(1)]
 
2166
 
 
2167
 
 
2168
_unescape_re = None
 
2169
 
 
2170
 
2138
2171
def _unescape_xml(data):
2139
 
    """Unescape &amp;, &lt;, and &gt; in a string of data.
2140
 
    """
2141
 
    data = data.replace("&lt;", "<")
2142
 
    data = data.replace("&gt;", ">")
2143
 
    # must do ampersand last
2144
 
    return data.replace("&amp;", "&")
 
2172
    """Unescape predefined XML entities in a string of data."""
 
2173
    global _unescape_re
 
2174
    if _unescape_re is None:
 
2175
        _unescape_re = re.compile('\&([^;]*);')
 
2176
    return _unescape_re.sub(_unescaper, data)