changeset 36543:3e458c583d2c

py3: use startswith() to check existence of trailing '\n' in .hgtags file
author Yuya Nishihara <yuya@tcha.org>
date Thu, 01 Mar 2018 16:32:45 -0500
parents 106e93d16435
children a16fceb686a7
files mercurial/tags.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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: