##// END OF EJS Templates
check-code: indent 4 spaces in py files
Mads Kiilerich -
r17299:e51d4aed stable
parent child Browse files
Show More
@@ -206,6 +206,7 b' pypats = ['
206 206 (r'\.debug\(\_', "don't mark debug messages for translation"),
207 207 (r'\.strip\(\)\.split\(\)', "no need to strip before splitting"),
208 208 (r'^\s*except\s*:', "warning: naked except clause", r'#.*re-raises'),
209 (r':\n( )*( ){1,3}[^ ]', "must indent 4 spaces"),
209 210 ],
210 211 # warnings
211 212 [
@@ -74,7 +74,7 b' def shouldtransform(node):'
74 74 'setattr' in sggparent or \
75 75 'encode' in sggparent or \
76 76 'decode' in sggparent:
77 return False
77 return False
78 78
79 79 return True
80 80
@@ -121,7 +121,7 b' def lfconvert(ui, src, dest, *pats, **op'
121 121 shutil.rmtree(rdst.root)
122 122
123 123 def _addchangeset(ui, rsrc, rdst, ctx, revmap):
124 # Convert src parents to dst parents
124 # Convert src parents to dst parents
125 125 parents = _convertparents(ctx, revmap)
126 126
127 127 # Generate list of changed files
@@ -506,7 +506,7 b' def _updatelfile(repo, lfdirstate, lfile'
506 506 # because otherwise the largefile will get reverted. But for commit's
507 507 # sake, we have to mark the file as unclean.
508 508 if getattr(repo, "_isrebasing", False):
509 lfdirstate.normallookup(lfile)
509 lfdirstate.normallookup(lfile)
510 510 else:
511 511 lfdirstate.normal(lfile)
512 512 elif state == 'r':
@@ -667,9 +667,9 b' def overridepull(orig, ui, repo, source='
667 667 repo._isrebasing = True
668 668 try:
669 669 if opts.get('update'):
670 del opts['update']
671 ui.debug('--update and --rebase are not compatible, ignoring '
672 'the update flag\n')
670 del opts['update']
671 ui.debug('--update and --rebase are not compatible, ignoring '
672 'the update flag\n')
673 673 del opts['rebase']
674 674 cmdutil.bailifchanged(repo)
675 675 origpostincoming = commands.postincoming
@@ -666,9 +666,9 b' def revsettransplanted(repo, subset, x):'
666 666 Transplanted changesets in set, or all transplanted changesets.
667 667 """
668 668 if x:
669 s = revset.getset(repo, subset, x)
669 s = revset.getset(repo, subset, x)
670 670 else:
671 s = subset
671 s = subset
672 672 return [r for r in s if repo[r].extra().get('transplant_source')]
673 673
674 674 def kwtransplanted(repo, ctx, **args):
@@ -4499,7 +4499,7 b' def phase(ui, repo, *revs, **opts):'
4499 4499 try:
4500 4500 # set phase
4501 4501 if not revs:
4502 raise util.Abort(_('empty revision set'))
4502 raise util.Abort(_('empty revision set'))
4503 4503 nodes = [repo[r].node() for r in revs]
4504 4504 olddata = repo._phasecache.getphaserevs(repo)[:]
4505 4505 phases.advanceboundary(repo, targetphase, nodes)
@@ -5442,7 +5442,7 b' def summary(ui, repo, **opts):'
5442 5442 # current bookmark not in parent ctx marks
5443 5443 pass
5444 5444 for m in marks:
5445 ui.write(' ' + m, label='log.bookmark')
5445 ui.write(' ' + m, label='log.bookmark')
5446 5446 ui.write('\n', label='log.bookmark')
5447 5447
5448 5448 st = list(repo.status(unknown=True))[:6]
@@ -169,7 +169,7 b' def _runcatch(req):'
169 169 try: # usually it is in the form (errno, strerror)
170 170 reason = inst.reason.args[1]
171 171 except (AttributeError, IndexError):
172 # it might be anything, for example a string
172 # it might be anything, for example a string
173 173 reason = inst.reason
174 174 ui.warn(_("abort: error: %s\n") % reason)
175 175 elif util.safehasattr(inst, "args") and inst.args[0] == errno.EPIPE:
@@ -272,7 +272,7 b' class localrepository(object):'
272 272 return bookmarks.readcurrent(self)
273 273
274 274 def _writebookmarks(self, marks):
275 bookmarks.write(self)
275 bookmarks.write(self)
276 276
277 277 def bookmarkheads(self, bookmark):
278 278 name = bookmark.split('@', 1)[0]
@@ -634,7 +634,7 b' class patchfile(object):'
634 634 if self.mode is None:
635 635 self.mode = (False, False)
636 636 if self.missing:
637 self.ui.warn(_("unable to find '%s' for patching\n") % self.fname)
637 self.ui.warn(_("unable to find '%s' for patching\n") % self.fname)
638 638
639 639 self.hash = {}
640 640 self.dirty = 0
@@ -1630,9 +1630,9 b' def diff(repo, node1=None, node2=None, m'
1630 1630 if opts.git or opts.upgrade:
1631 1631 copy = copies.pathcopies(ctx1, ctx2)
1632 1632
1633 difffn = (lambda opts, losedata:
1634 trydiff(repo, revs, ctx1, ctx2, modified, added, removed,
1635 copy, getfilectx, opts, losedata, prefix))
1633 def difffn(opts, losedata):
1634 return trydiff(repo, revs, ctx1, ctx2, modified, added, removed,
1635 copy, getfilectx, opts, losedata, prefix)
1636 1636 if opts.upgrade and not opts.git:
1637 1637 try:
1638 1638 def losedata(fn):
General Comments 0
You need to be logged in to leave comments. Login now