/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/branch.py

  • Committer: Jelmer Vernooij
  • Date: 2018-11-11 04:08:32 UTC
  • mto: (7143.16.20 even-more-cleanups)
  • mto: This revision was merged to the branch mainline in revision 7175.
  • Revision ID: jelmer@jelmer.uk-20181111040832-nsljjynzzwmznf3h
Run autopep8.

Show diffs side-by-side

added added

removed removed

Lines of Context:
305
305
        new_history = []
306
306
        check_not_reserved_id = _mod_revision.check_not_reserved_id
307
307
        # Do not include ghosts or graph origin in revision_history
308
 
        while (current_rev_id in parents_map and
309
 
               len(parents_map[current_rev_id]) > 0):
 
308
        while (current_rev_id in parents_map
 
309
               and len(parents_map[current_rev_id]) > 0):
310
310
            check_not_reserved_id(current_rev_id)
311
311
            new_history.append(current_rev_id)
312
312
            current_rev_id = parents_map[current_rev_id][0]
442
442
            in self.iter_merge_sorted_revisions()}
443
443
        return revision_id_to_revno
444
444
 
445
 
    def iter_merge_sorted_revisions(self, start_revision_id=None, 
 
445
    def iter_merge_sorted_revisions(self, start_revision_id=None,
446
446
                                    stop_revision_id=None,
447
447
                                    stop_rule='exclude', direction='reverse'):
448
448
        """Walk the revisions for a branch in merge sorted order.
573
573
                if rev_id == left_parent:
574
574
                    # reached the left parent after the stop_revision
575
575
                    return
576
 
                if (not reached_stop_revision_id or
577
 
                        rev_id in revision_id_whitelist):
 
576
                if (not reached_stop_revision_id
 
577
                        or rev_id in revision_id_whitelist):
578
578
                    yield (rev_id, node.merge_depth, node.revno,
579
579
                           node.end_of_merge)
580
580
                    if reached_stop_revision_id or rev_id == stop_revision_id:
832
832
            pb.update(gettext("Unstacking"))
833
833
            # The basic approach here is to fetch the tip of the branch,
834
834
            # including all available ghosts, from the existing stacked
835
 
            # repository into a new repository object without the fallbacks. 
 
835
            # repository into a new repository object without the fallbacks.
836
836
            #
837
837
            # XXX: See <https://launchpad.net/bugs/397286> - this may not be
838
838
            # correct for CHKMap repostiories
1215
1215
        return result
1216
1216
 
1217
1217
    def sprout(self, to_controldir, revision_id=None, repository_policy=None,
1218
 
            repository=None, lossy=False):
 
1218
               repository=None, lossy=False):
1219
1219
        """Create a new line of development from the branch, into to_controldir.
1220
1220
 
1221
1221
        to_controldir controls the branch format.
1223
1223
        revision_id: if not None, the revision history in the new branch will
1224
1224
                     be truncated to end with revision_id.
1225
1225
        """
1226
 
        if (repository_policy is not None and
1227
 
                repository_policy.requires_stacking()):
 
1226
        if (repository_policy is not None
 
1227
                and repository_policy.requires_stacking()):
1228
1228
            to_controldir._format.require_stacking(_skip_repo=True)
1229
1229
        result = to_controldir.create_branch(repository=repository)
1230
1230
        if lossy:
1341
1341
        """
1342
1342
        # XXX: Fix the bzrdir API to allow getting the branch back from the
1343
1343
        # clone call. Or something. 20090224 RBC/spiv.
1344
 
        # XXX: Should this perhaps clone colocated branches as well, 
 
1344
        # XXX: Should this perhaps clone colocated branches as well,
1345
1345
        # rather than just the default branch? 20100319 JRV
1346
1346
        if revision_id is None:
1347
1347
            revision_id = self.last_revision()
1383
1383
                pass
1384
1384
            else:
1385
1385
                raise errors.AlreadyControlDirError(t.base)
1386
 
            if (checkout.control_transport.base ==
1387
 
                    self.controldir.control_transport.base):
 
1386
            if (checkout.control_transport.base
 
1387
                    == self.controldir.control_transport.base):
1388
1388
                # When checking out to the same control directory,
1389
1389
                # always create a lightweight checkout
1390
1390
                lightweight = True
1883
1883
 
1884
1884
    def get_default(self):
1885
1885
        """Return the current default format."""
1886
 
        if (self._default_format_key is not None and
1887
 
                self._default_format is None):
 
1886
        if (self._default_format_key is not None
 
1887
                and self._default_format is None):
1888
1888
            self._default_format = self.get(self._default_format_key)
1889
1889
        return self._default_format
1890
1890
 
2364
2364
            # the source one.
2365
2365
            self.source.update_references(self.target)
2366
2366
            graph = self.target.repository.get_graph(self.source.repository)
2367
 
            # TODO: Branch formats should have a flag that indicates 
 
2367
            # TODO: Branch formats should have a flag that indicates
2368
2368
            # that revno's are expensive, and pull() should honor that flag.
2369
2369
            # -- JRV20090506
2370
2370
            result.old_revno, result.old_revid = \