comparison mercurial/cmdutil.py @ 27417:9073a1e457c9

export: remove useless comparison between file object and string It was introduced at 31aa2e5b0750, where "template" argument could be a file object. After that, a306837f8c87 added "len(template)", so "template" must be a string now. Therefore, "fp != template" should always be True. It seems 31aa2e5b0750 was intended to work around a bug in TortoiseHg, and I'm sure I've fixed it completely in TortoiseHg source. https://selenic.com/pipermail/mercurial-devel/2011-February/028467.html
author Yuya Nishihara <yuya@tcha.org>
date Sun, 13 Dec 2015 19:57:54 +0900
parents 9d04b4da6773
children 2ce4661ac226
comparison
equal deleted inserted replaced
27416:9d04b4da6773 27417:9073a1e457c9
1052 desc_lines = ctx.description().rstrip().split('\n') 1052 desc_lines = ctx.description().rstrip().split('\n')
1053 desc = desc_lines[0] #Commit always has a first line. 1053 desc = desc_lines[0] #Commit always has a first line.
1054 fp = makefileobj(repo, template, node, desc=desc, total=total, 1054 fp = makefileobj(repo, template, node, desc=desc, total=total,
1055 seqno=seqno, revwidth=revwidth, mode='wb', 1055 seqno=seqno, revwidth=revwidth, mode='wb',
1056 modemap=filemode) 1056 modemap=filemode)
1057 if fp != template: 1057 shouldclose = True
1058 shouldclose = True
1059 if fp and not getattr(fp, 'name', '<unnamed>').startswith('<'): 1058 if fp and not getattr(fp, 'name', '<unnamed>').startswith('<'):
1060 repo.ui.note("%s\n" % fp.name) 1059 repo.ui.note("%s\n" % fp.name)
1061 1060
1062 if not fp: 1061 if not fp:
1063 write = repo.ui.write 1062 write = repo.ui.write