fix switchBranch method

This commit is contained in:
Fabio Erculiani
2009-06-10 13:48:13 +02:00
parent 47ada52846
commit 4883c07919
+1 -11
View File
@@ -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):