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

  • Committer: Jelmer Vernooij
  • Date: 2018-11-12 01:41:38 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-20181112014138-3b0zyx91cu3wdq3k
More PEP8 fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
210
210
            revprops = {}
211
211
        if possible_master_transports is None:
212
212
            possible_master_transports = []
213
 
        if (not u'branch-nick' in revprops and
 
213
        if (u'branch-nick' not in revprops and
214
214
                branch.repository._format.supports_storing_branch_nick):
215
215
            revprops[u'branch-nick'] = branch._get_nick(
216
216
                local,
250
250
        """Commit working copy as a new revision.
251
251
 
252
252
        :param message: the commit message (it or message_callback is required)
253
 
        :param message_callback: A callback: message = message_callback(cmt_obj)
 
253
        :param message_callback: A callback: message =
 
254
            message_callback(cmt_obj)
254
255
 
255
256
        :param timestamp: if not None, seconds-since-epoch for a
256
257
            postdated/predated commit.
324
325
                if isinstance(message, bytes):
325
326
                    message = message.decode(get_user_encoding())
326
327
 
327
 
                def message_callback(x): return message
 
328
                def message_callback(x):
 
329
                    return message
328
330
            else:
329
331
                raise BzrError("The message or message_callback keyword"
330
332
                               " parameter is required for commit().")
411
413
        # Collect the changes
412
414
        self._set_progress_stage("Collecting changes", counter=True)
413
415
        self._lossy = lossy
414
 
        self.builder = self.branch.get_commit_builder(self.parents,
415
 
                                                      self.config_stack, timestamp, timezone, committer, self.revprops,
416
 
                                                      rev_id, lossy=lossy)
 
416
        self.builder = self.branch.get_commit_builder(
 
417
            self.parents, self.config_stack, timestamp, timezone, committer,
 
418
            self.revprops, rev_id, lossy=lossy)
417
419
 
418
420
        if self.builder.updates_branch and self.bound_branch:
419
421
            self.builder.abort()
448
450
            # Add revision data to the local branch
449
451
            self.rev_id = self.builder.commit(self.message)
450
452
 
451
 
        except Exception as e:
 
453
        except Exception:
452
454
            mutter("aborting commit write group because of exception:")
453
455
            trace.log_exception_quietly()
454
456
            self.builder.abort()
497
499
        else:
498
500
            try:
499
501
                self._process_pre_hooks(old_revno, new_revno)
500
 
            except:
 
502
            except BaseException:
501
503
                # The commit builder will already have updated the branch,
502
504
                # revert it.
503
505
                self.branch.set_last_revision_info(old_revno, old_revid)
551
553
        # If the master branch is bound, we must fail
552
554
        master_bound_location = self.master_branch.get_bound_location()
553
555
        if master_bound_location:
554
 
            raise errors.CommitToDoubleBoundBranch(self.branch,
555
 
                                                   self.master_branch, master_bound_location)
 
556
            raise errors.CommitToDoubleBoundBranch(
 
557
                self.branch, self.master_branch, master_bound_location)
556
558
 
557
559
        # TODO: jam 20051230 We could automatically push local
558
560
        #       commits to the remote branch if they would fit.
670
672
        mutter("Selecting files for commit with filter %r", specific_files)
671
673
 
672
674
        self._check_strict()
673
 
        iter_changes = self.work_tree.iter_changes(self.basis_tree,
674
 
                                                   specific_files=specific_files)
 
675
        iter_changes = self.work_tree.iter_changes(
 
676
            self.basis_tree, specific_files=specific_files)
675
677
        if self.exclude:
676
678
            iter_changes = filter_excluded(iter_changes, self.exclude)
677
679
        iter_changes = self._filter_iter_changes(iter_changes)
682
684
    def _filter_iter_changes(self, iter_changes):
683
685
        """Process iter_changes.
684
686
 
685
 
        This method reports on the changes in iter_changes to the user, and 
 
687
        This method reports on the changes in iter_changes to the user, and
686
688
        converts 'missing' entries in the iter_changes iterator to 'deleted'
687
689
        entries. 'missing' entries have their
688
690
 
759
761
            return sub_tree.commit(message=None, revprops=self.revprops,
760
762
                                   recursive=self.recursive,
761
763
                                   message_callback=self.message_callback,
762
 
                                   timestamp=self.timestamp, timezone=self.timezone,
 
764
                                   timestamp=self.timestamp,
 
765
                                   timezone=self.timezone,
763
766
                                   committer=self.committer,
764
767
                                   allow_pointless=self.allow_pointless,
765
768
                                   strict=self.strict, verbose=self.verbose,