Mercurial > hg
comparison hgext/mq.py @ 31432:6e1c79578e5c
mq: explicitly tests for None
Changeset fd3d8eb7f545 removed the mutable default value, but did not explicitly
tested for None. Such implicit testing can introduce semantic and performance
issue. We move to an explicit testing for None as recommended by PEP8:
https://www.python.org/dev/peps/pep-0008/#programming-recommendations
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Wed, 15 Mar 2017 15:05:54 -0700 |
parents | b8848750a3c1 |
children | 03d99d08147b |
comparison
equal
deleted
inserted
replaced
31431:406705701c2d | 31432:6e1c79578e5c |
---|---|
720 else: | 720 else: |
721 util.rename(absf, absorig) | 721 util.rename(absf, absorig) |
722 | 722 |
723 def printdiff(self, repo, diffopts, node1, node2=None, files=None, | 723 def printdiff(self, repo, diffopts, node1, node2=None, files=None, |
724 fp=None, changes=None, opts=None): | 724 fp=None, changes=None, opts=None): |
725 opts = opts or {} | 725 if opts is None: |
726 opts = {} | |
726 stat = opts.get('stat') | 727 stat = opts.get('stat') |
727 m = scmutil.match(repo[node1], files, opts) | 728 m = scmutil.match(repo[node1], files, opts) |
728 cmdutil.diffordiffstat(self.ui, repo, diffopts, node1, node2, m, | 729 cmdutil.diffordiffstat(self.ui, repo, diffopts, node1, node2, m, |
729 changes, stat, fp) | 730 changes, stat, fp) |
730 | 731 |