Mercurial > public > mercurial-scm > hg-stable
diff mercurial/commands.py @ 674:6513ba7d858a
Make consistent use of str.startswith() in conditionals.
# HG changeset patch
# User chad.netzer@gmail.com
# Node ID 45db196de89a15fd045cd789f701b0180fd276f1
# Parent fafc16f705b6cb413897577b67918af55e1baafe
Make consistent use of str.startswith() in conditionals.
author | chad.netzer@gmail.com |
---|---|
date | Sun, 10 Jul 2005 16:14:56 -0800 |
parents | d93f0b127b6a |
children | 49de76abc4da |
line wrap: on
line diff
--- a/mercurial/commands.py Sun Jul 10 16:14:41 2005 -0800 +++ b/mercurial/commands.py Sun Jul 10 16:14:56 2005 -0800 @@ -606,10 +606,10 @@ ui.debug(t,'\n') if t == '# HG changeset patch' or hgpatch == True: hgpatch = True - if t[:7] == "# User ": + if t.startswith("# User "): user = t[7:] ui.debug('User: %s\n' % user) - if t[:2] <> "# " and t.strip() and not snippet: snippet = t + if not t.startswith("# ") and t.strip() and not snippet: snippet = t if snippet: text = snippet + '\n' + text ui.debug('text:\n%s\n' % text) @@ -621,7 +621,7 @@ for l in f.read().splitlines(): l.rstrip('\r\n'); ui.status("%s\n" % l) - if l[:14] == 'patching file ': + if l.startswith('patching file '): pf = l[14:] if pf not in files: files.append(pf)