Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 9031:3b76321aa0de
compat: use open() instead of file() everywhere
author | Alejandro Santos <alejolp@alejolp.com> |
---|---|
date | Sun, 05 Jul 2009 11:01:30 +0200 |
parents | ada93c6bf554 |
children | 8e34f363dd77 |
comparison
equal
deleted
inserted
replaced
9030:3f56055ff1d7 | 9031:3b76321aa0de |
---|---|
748 if ui.verbose: | 748 if ui.verbose: |
749 cmdlist = [' '.join(c[0]) for c in cmdlist.values()] | 749 cmdlist = [' '.join(c[0]) for c in cmdlist.values()] |
750 ui.write("%s\n" % "\n".join(sorted(cmdlist))) | 750 ui.write("%s\n" % "\n".join(sorted(cmdlist))) |
751 | 751 |
752 def debugfsinfo(ui, path = "."): | 752 def debugfsinfo(ui, path = "."): |
753 file('.debugfsinfo', 'w').write('') | 753 open('.debugfsinfo', 'w').write('') |
754 ui.write('exec: %s\n' % (util.checkexec(path) and 'yes' or 'no')) | 754 ui.write('exec: %s\n' % (util.checkexec(path) and 'yes' or 'no')) |
755 ui.write('symlink: %s\n' % (util.checklink(path) and 'yes' or 'no')) | 755 ui.write('symlink: %s\n' % (util.checklink(path) and 'yes' or 'no')) |
756 ui.write('case-sensitive: %s\n' % (util.checkcase('.debugfsinfo') | 756 ui.write('case-sensitive: %s\n' % (util.checkcase('.debugfsinfo') |
757 and 'yes' or 'no')) | 757 and 'yes' or 'no')) |
758 os.unlink('.debugfsinfo') | 758 os.unlink('.debugfsinfo') |
981 patchproblems += 1 | 981 patchproblems += 1 |
982 else: | 982 else: |
983 if list(files) != [os.path.basename(fa)]: | 983 if list(files) != [os.path.basename(fa)]: |
984 ui.write(_(" unexpected patch output!\n")) | 984 ui.write(_(" unexpected patch output!\n")) |
985 patchproblems += 1 | 985 patchproblems += 1 |
986 a = file(fa).read() | 986 a = open(fa).read() |
987 if a != b: | 987 if a != b: |
988 ui.write(_(" patch test failed!\n")) | 988 ui.write(_(" patch test failed!\n")) |
989 patchproblems += 1 | 989 patchproblems += 1 |
990 | 990 |
991 if patchproblems: | 991 if patchproblems: |