# HG changeset patch # User Yuya Nishihara # Date 1519939965 18000 # Node ID 3e458c583d2c644c129a51d4eb56e0dcdd471742 # Parent 106e93d16435487fbbb56d0e29dce79032a6eea1 py3: use startswith() to check existence of trailing '\n' in .hgtags file diff -r 106e93d16435 -r 3e458c583d2c mercurial/tags.py --- a/mercurial/tags.py Thu Mar 01 15:57:27 2018 -0500 +++ b/mercurial/tags.py Thu Mar 01 16:32:45 2018 -0500 @@ -559,7 +559,7 @@ def writetags(fp, names, munge, prevtags): fp.seek(0, 2) - if prevtags and prevtags[-1] != '\n': + if prevtags and not prevtags.endswith('\n'): fp.write('\n') for name in names: if munge: