Mercurial > public > mercurial-scm > hg
comparison mercurial/debugcommands.py @ 41365:876494fd967d
cleanup: delete lots of unused local variables
These were found by IntelliJ. There are many more, but these seemed
pretty safe.
Differential Revision: https://phab.mercurial-scm.org/D5629
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Thu, 17 Jan 2019 09:17:12 -0800 |
parents | a59a74721c76 |
children | 7dc160a57025 |
comparison
equal
deleted
inserted
replaced
41364:0132221c25cd | 41365:876494fd967d |
---|---|
743 nodates = not opts[r'dates'] | 743 nodates = not opts[r'dates'] |
744 if opts.get(r'nodates') is not None: | 744 if opts.get(r'nodates') is not None: |
745 nodates = True | 745 nodates = True |
746 datesort = opts.get(r'datesort') | 746 datesort = opts.get(r'datesort') |
747 | 747 |
748 timestr = "" | |
749 if datesort: | 748 if datesort: |
750 keyfunc = lambda x: (x[1][3], x[0]) # sort by mtime, then by filename | 749 keyfunc = lambda x: (x[1][3], x[0]) # sort by mtime, then by filename |
751 else: | 750 else: |
752 keyfunc = None # sort by filename | 751 keyfunc = None # sort by filename |
753 for file_, ent in sorted(repo.dirstate._map.iteritems(), key=keyfunc): | 752 for file_, ent in sorted(repo.dirstate._map.iteritems(), key=keyfunc): |
1179 '''test Mercurial installation | 1178 '''test Mercurial installation |
1180 | 1179 |
1181 Returns 0 on success. | 1180 Returns 0 on success. |
1182 ''' | 1181 ''' |
1183 opts = pycompat.byteskwargs(opts) | 1182 opts = pycompat.byteskwargs(opts) |
1184 | |
1185 def writetemp(contents): | |
1186 (fd, name) = pycompat.mkstemp(prefix="hg-debuginstall-") | |
1187 f = os.fdopen(fd, r"wb") | |
1188 f.write(contents) | |
1189 f.close() | |
1190 return name | |
1191 | 1183 |
1192 problems = 0 | 1184 problems = 0 |
1193 | 1185 |
1194 fm = ui.formatter('debuginstall', opts) | 1186 fm = ui.formatter('debuginstall', opts) |
1195 fm.startitem() | 1187 fm.startitem() |
2567 "server specified")) | 2559 "server specified")) |
2568 source = "default" | 2560 source = "default" |
2569 | 2561 |
2570 source, branches = hg.parseurl(ui.expandpath(source)) | 2562 source, branches = hg.parseurl(ui.expandpath(source)) |
2571 url = util.url(source) | 2563 url = util.url(source) |
2572 addr = None | |
2573 | 2564 |
2574 defaultport = {'https': 443, 'ssh': 22} | 2565 defaultport = {'https': 443, 'ssh': 22} |
2575 if url.scheme in defaultport: | 2566 if url.scheme in defaultport: |
2576 try: | 2567 try: |
2577 addr = (url.host, int(url.port or defaultport[url.scheme])) | 2568 addr = (url.host, int(url.port or defaultport[url.scheme])) |