mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 07:17:55 +03:00
fixed some stuff pychecker shows, marked unclear/wrong stuff with XXX
This commit is contained in:
parent
584aa09dd6
commit
55d74a6b77
@ -644,7 +644,7 @@ def cat(ui, repo, file1, *pats, **opts):
|
||||
n = mf[abs]
|
||||
except (hg.RepoError, KeyError):
|
||||
try:
|
||||
n = r.lookup(rev)
|
||||
n = r.lookup(rev) # XXX rev undefined!
|
||||
except KeyError, inst:
|
||||
raise util.Abort(_('cannot find file %s in rev %s'), rel, rev)
|
||||
else:
|
||||
@ -1016,7 +1016,7 @@ def debugrename(ui, repo, file, rev=None):
|
||||
change = repo.changelog.read(n)
|
||||
m = repo.manifest.read(change[0])
|
||||
n = m[relpath(repo, [file])[0]]
|
||||
except hg.RepoError, KeyError:
|
||||
except (hg.RepoError, KeyError):
|
||||
n = r.lookup(rev)
|
||||
else:
|
||||
n = r.tip()
|
||||
@ -2470,7 +2470,7 @@ def dispatch(args):
|
||||
|
||||
external = []
|
||||
for x in u.extensions():
|
||||
def on_exception(Exception, inst):
|
||||
def on_exception(Exception, inst): # XXX Exception is a builtin name!?
|
||||
u.warn(_("*** failed to import extension %s\n") % x[1])
|
||||
u.warn("%s\n" % inst)
|
||||
if "--traceback" in sys.argv[1:]:
|
||||
|
@ -213,7 +213,7 @@ class dirstate:
|
||||
unknown = []
|
||||
|
||||
for x in files:
|
||||
if x is '.':
|
||||
if x == '.':
|
||||
return self.map.copy()
|
||||
if x not in self.map:
|
||||
unknown.append(x)
|
||||
@ -296,7 +296,6 @@ class dirstate:
|
||||
def walkhelper(self, files, statmatch, dc):
|
||||
# recursion free walker, faster than os.walk.
|
||||
def findfiles(s):
|
||||
retfiles = []
|
||||
work = [s]
|
||||
while work:
|
||||
top = work.pop()
|
||||
|
@ -1,10 +1,10 @@
|
||||
import getopt
|
||||
|
||||
def fancyopts(args, options, state):
|
||||
long=[]
|
||||
short=''
|
||||
map={}
|
||||
dt={}
|
||||
long = []
|
||||
short = ''
|
||||
map = {}
|
||||
dt = {}
|
||||
|
||||
for s, l, d, c in options:
|
||||
pl = l.replace('-', '_')
|
||||
|
@ -58,7 +58,7 @@ class filelog(revlog):
|
||||
return self.addrevision(text, transaction, link, p1, p2)
|
||||
|
||||
def renamed(self, node):
|
||||
if 0 and self.parents(node)[0] != nullid:
|
||||
if 0 and self.parents(node)[0] != nullid: # XXX
|
||||
return False
|
||||
m = self.readmeta(node)
|
||||
if m and m.has_key("copy"):
|
||||
|
@ -954,7 +954,7 @@ def create_server(repo):
|
||||
def server(path, name, templates, address, port, use_ipv6=False,
|
||||
accesslog=sys.stdout, errorlog=sys.stderr):
|
||||
httpd = create_server(path, name, templates, address, port, use_ipv6,
|
||||
accesslog, errorlog)
|
||||
accesslog, errorlog) # XXX wrong param count
|
||||
httpd.serve_forever()
|
||||
|
||||
# This is a stopgap
|
||||
|
@ -5,7 +5,7 @@
|
||||
# This software may be used and distributed according to the terms
|
||||
# of the GNU General Public License, incorporated herein by reference.
|
||||
|
||||
import sys, struct
|
||||
import struct
|
||||
from revlog import *
|
||||
from i18n import gettext as _
|
||||
from demandload import *
|
||||
|
@ -7,7 +7,7 @@ This software may be used and distributed according to the terms
|
||||
of the GNU General Public License, incorporated herein by reference.
|
||||
"""
|
||||
|
||||
import sha, binascii
|
||||
import binascii
|
||||
|
||||
nullid = "\0" * 20
|
||||
|
||||
|
@ -12,7 +12,6 @@
|
||||
# of the GNU General Public License, incorporated herein by reference.
|
||||
|
||||
import os
|
||||
import util
|
||||
from i18n import gettext as _
|
||||
|
||||
class transaction:
|
||||
|
@ -158,9 +158,11 @@ def pathto(n1, n2):
|
||||
this returns a path in the form used by the local filesystem, not hg.'''
|
||||
if not n1: return localpath(n2)
|
||||
a, b = n1.split('/'), n2.split('/')
|
||||
a.reverse(), b.reverse()
|
||||
a.reverse()
|
||||
b.reverse()
|
||||
while a and b and a[-1] == b[-1]:
|
||||
a.pop(), b.pop()
|
||||
a.pop()
|
||||
b.pop()
|
||||
b.reverse()
|
||||
return os.sep.join((['..'] * len(a)) + b)
|
||||
|
||||
@ -253,7 +255,7 @@ def _matcher(canonroot, cwd, names, inc, exc, head, dflt_pat):
|
||||
try:
|
||||
pat = '(?:%s)' % regex(k, p, tail)
|
||||
matches.append(re.compile(pat).match)
|
||||
except re.error, inst:
|
||||
except re.error:
|
||||
raise Abort("invalid pattern: %s:%s" % (k, p))
|
||||
|
||||
def buildfn(text):
|
||||
|
Loading…
Reference in New Issue
Block a user