mercurial/commands.py
changeset 674 6513ba7d858a
parent 668 d93f0b127b6a
child 675 49de76abc4da
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -606,10 +606,10 @@ def import_(ui, repo, patch1, *patches, 
             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 @@ def import_(ui, repo, patch1, *patches, 
         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)