[kernel] r5196 - people/waldi/linux-2.6/debian/bin

Bastian Blank waldi at costa.debian.org
Tue Jan 3 15:18:56 UTC 2006


Author: waldi
Date: Tue Jan  3 15:18:55 2006
New Revision: 5196

Modified:
   people/waldi/linux-2.6/debian/bin/apply.py
Log:
debian/bin/apply.py: Don't record extra version without patch.


Modified: people/waldi/linux-2.6/debian/bin/apply.py
==============================================================================
--- people/waldi/linux-2.6/debian/bin/apply.py	(original)
+++ people/waldi/linux-2.6/debian/bin/apply.py	Tue Jan  3 15:18:55 2006
@@ -49,6 +49,7 @@
         return '<%s object for %s>' % (self.__class__.__name__, self.name)
 
     def apply(self):
+        changes = 0
         if self.reverse:
             for operation, patch, patchinfo in self[::-1]:
                 if operation == '.':
@@ -57,13 +58,16 @@
 """ % patch
                 elif operation == '+':
                     self.patch_deapply(patch, patchinfo)
+                    changes += 1
                 elif operation == '-':
                     self.patch_apply(patch, patchinfo)
+                    changes += 1
                 elif operation == 'X':
                     os.rename(patchinfo[1], patchinfo[0])
                     print """\
   (X) RESTORED  %s\
 """ % patch
+                    changes += 1
             print "--> %s fully unapplied." % self.name
 
         else:
@@ -74,14 +78,18 @@
 """ % patch
                 elif operation == '+':
                     self.patch_apply(patch, patchinfo)
+                    changes += 1
                 elif operation == '-':
                     self.patch_deapply(patch, patchinf)
+                    changes += 1
                 elif operation == 'X':
                     os.rename(patchinfo[0], patchinfo[1])
                     print """\
   (X) REMOVED   %s\
 """ % patch
+                    changes += 1
             print "--> %s fully applied." % self.name
+        return changes
 
     def patch_apply(self, patch, patchinfo):
         ret = self.patch_call(patchinfo, '--fuzz=1')
@@ -309,9 +317,13 @@
         consider = revisions[current_index:0:-1]
         s = series_extra.read_all(consider, home, current_extra, reverse = True)
         vfile.begin()
+        changes = 0
         for i in s:
-            i.apply()
-        vfile.commit(current, ())
+            changes += i.apply()
+        if changes:
+            vfile.commit(current, ())
+        else:
+            vfile.commit()
 
     if current_index < target_index:
         consider = revisions[current_index + 1:target_index + 1]
@@ -332,9 +344,13 @@
         consider = revisions[1:target_index + 1]
         s = series_extra.read_all(consider, home, target_extra)
         vfile.begin()
+        changes = 0
         for i in s:
-            i.apply()
-        vfile.commit(target, target_extra)
+            changes += i.apply()
+        if changes:
+            vfile.commit(target, target_extra)
+        else:
+            vfile.commit()
 
 def parse_options():
     from optparse import OptionParser



More information about the Kernel-svn-changes mailing list