changeset 686:d7d68d27ebe5

Reapply startswith() changes that got lost with stale edit manifest hash: 16d7feedd561591a21727a4c13a1223019d802a7
author Matt Mackall <mpm@selenic.com>
date Tue, 12 Jul 2005 00:51:49 -0800
parents 79fb7032739f
children 44b30755d07c
files mercurial/hg.py
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hg.py	Mon Jul 11 21:58:57 2005 -0800
+++ b/mercurial/hg.py	Tue Jul 12 00:51:49 2005 -0800
@@ -21,14 +21,14 @@
 
     def read(self, node):
         t = self.revision(node)
-        if t[:2] != '\1\n':
+        if not t.startswith('\1\n'):
             return t
         s = t.find('\1\n', 2)
         return t[s+2:]
 
     def readmeta(self, node):
         t = self.revision(node)
-        if t[:2] != '\1\n':
+        if not t.startswith('\1\n'):
             return t
         s = t.find('\1\n', 2)
         mt = t[2:s]
@@ -38,7 +38,7 @@
         return m
 
     def add(self, text, meta, transaction, link, p1=None, p2=None):
-        if meta or text[:2] == '\1\n':
+        if meta or text.startswith('\1\n'):
             mt = ""
             if meta:
                 mt = [ "%s: %s\n" % (k, v) for k,v in meta.items() ]
@@ -436,7 +436,7 @@
 def opener(base):
     p = base
     def o(path, mode="r"):
-        if p[:7] == "http://":
+        if p.startswith("http://"):
             f = os.path.join(p, urllib.quote(path))
             return httprangereader.httprangereader(f)
 
@@ -465,7 +465,7 @@
 class localrepository:
     def __init__(self, ui, path=None, create=0):
         self.remote = 0
-        if path and path[:7] == "http://":
+        if path and path.startswith("http://"):
             self.remote = 1
             self.path = path
         else: