/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 breezy/repository.py

  • Committer: Breezy landing bot
  • Author(s): Martin
  • Date: 2017-06-05 21:50:19 UTC
  • mfrom: (6656.1.3 dict_viewing)
  • Revision ID: breezy.the.bot@gmail.com-20170605215019-uw7s07tx11p194kh
Apply 2to3 dict fixer and clean up with sixish view methods

Merged from https://code.launchpad.net/~gz/brz/dict_viewing/+merge/325108

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
from .decorators import needs_read_lock, needs_write_lock, only_raises
49
49
from .inter import InterObject
50
50
from .lock import _RelockDebugMixin, LogicalLockResult
 
51
from .sixish import (
 
52
    viewitems,
 
53
    viewvalues,
 
54
    )
51
55
from .trace import (
52
56
    log_exception_quietly, note, mutter, mutter_callsite, warning)
53
57
 
141
145
            raise ValueError('Invalid value for %s: %r' % (context, text))
142
146
 
143
147
    def _validate_revprops(self, revprops):
144
 
        for key, value in revprops.iteritems():
 
148
        for key, value in viewitems(revprops):
145
149
            # We know that the XML serializers do not round trip '\r'
146
150
            # correctly, so refuse to accept them
147
151
            if not isinstance(value, basestring):
911
915
        :return: set of revisions that are parents of revision_ids which are
912
916
            not part of revision_ids themselves
913
917
        """
914
 
        parent_map = self.get_parent_map(revision_ids)
915
 
        parent_ids = set(itertools.chain.from_iterable(
916
 
            parent_map.itervalues()))
 
918
        parent_ids = set(itertools.chain.from_iterable(viewvalues(
 
919
                self.get_parent_map(revision_ids))))
917
920
        parent_ids.difference_update(revision_ids)
918
921
        parent_ids.discard(_mod_revision.NULL_REVISION)
919
922
        return parent_ids
1053
1056
            else:
1054
1057
                query_keys.append((revision_id ,))
1055
1058
        vf = self.revisions.without_fallbacks()
1056
 
        for ((revision_id,), parent_keys) in \
1057
 
                vf.get_parent_map(query_keys).iteritems():
 
1059
        for (revision_id,), parent_keys in viewitems(
 
1060
                vf.get_parent_map(query_keys)):
1058
1061
            if parent_keys:
1059
1062
                result[revision_id] = tuple([parent_revid
1060
1063
                    for (parent_revid,) in parent_keys])
1747
1750
    # Filter ghosts, and null:
1748
1751
    if _mod_revision.NULL_REVISION in revision_graph:
1749
1752
        del revision_graph[_mod_revision.NULL_REVISION]
1750
 
    for key, parents in revision_graph.items():
 
1753
    for key, parents in viewitems(revision_graph):
1751
1754
        revision_graph[key] = tuple(parent for parent in parents if parent
1752
1755
            in revision_graph)
1753
1756
    return revision_graph