1. Robot Mirror
  2. bugs.python.org

Commits

martin.v.loewis  committed d43e4d6

Support empty bases.

  • Participants
  • Parent commits 1616a0c
  • Branches default

Comments (0)

Files changed (1)

File scripts/addpatchsets

View file
  • Ignore whitespace
     try:
         r = urllib2.urlopen("http://hg.python.org/cpython/raw-file/"+rev+"/"+filename)
     except urllib2.HTTPError:
-        return None
-    base = engine.UnifyLinebreaks(r.read())
+        # not found/not accessible
+        # assume that the file did not exist in the base revision
+        # and consider it empty. If the problem was different (i.e. there should have
+        # been a non-empty base, patching will fail.
+        base = ""
+    else:
+        base = engine.UnifyLinebreaks(r.read())
     lines = base.splitlines(True)
-    #import pdb; pdb.set_trace()
     for (start, end), newrange, oldlines, newlines in chunks:
         if lines[start:end] != oldlines:
             if verbose: