From 4883c07919c4cf3350741d4cd36bf99fcf99be94 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Wed, 10 Jun 2009 13:48:13 +0200 Subject: [PATCH] fix switchBranch method --- libraries/entropy/db.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/libraries/entropy/db.py b/libraries/entropy/db.py index 6f242ff1b..a15a9d56c 100644 --- a/libraries/entropy/db.py +++ b/libraries/entropy/db.py @@ -3801,23 +3801,13 @@ class LocalRepository: dirs |= set(map(unicode, mystr.split())) return sorted(list(dirs)) - def switchBranch(self, idpackage, tobranch): - - key, slot = self.retrieveKeySlot(idpackage) - - # if there are entries already, remove idpackage directly - my_idpackage, result = self.atomMatch(key, matchSlot = slot, - matchBranches = (tobranch,)) - if my_idpackage != -1: return False - - # otherwise, update the old one (set the new branch) + def switchBranch(self, idpackage, tobranch): with self.__write_mutex: self.cursor.execute(""" UPDATE baseinfo SET branch = (?) WHERE idpackage = (?)""", (tobranch, idpackage,)) self.commitChanges() self.clearCache() - return True def databaseStructureUpdates(self):