Beispiel #1
0
 def do_drop(self, args):
     print 'Dropping all patches'
     for o in session.query(PatchSet).all():
         print ' - ', o.name
         session.delete(o)
     session.commit()
     print 'Done'
Beispiel #2
0
    def _do_apply_filename(self, target_filename):
        print 'Applying patches to: %s' % target_filename

        patches = PatchManager.get_patches_for_filename(target_filename)
        patch_datas = [p.patch_data for p in patches]
        print ' - Patches Found: %d' % len(patches)

        try:
            # Apply the patches:
            PatchManager.apply_patchs(target_filename, patch_datas)

            # Remove these patches from the database:
            for p in patches:
                session.delete(p)
            session.commit()
            PatchManager.clear_empty_patchsets()
        except PatchApplyError:
            print 'Error applying patch to XX'