Author: poeml Date: Mon May 31 17:45:34 2010 New Revision: 8069 URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain?rev=8069&view=rev Log: mb makehashes: - The command tried to insert files into the database even though they existed already. Regression introduced with r8065 (last commit). Modified: trunk/mb/mb/hashes.py Modified: trunk/mb/mb/hashes.py URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/mb/mb/hashes.py?rev=8069&r1=8068&r2=8069&view=diff ============================================================================== --- trunk/mb/mb/hashes.py (original) +++ trunk/mb/mb/hashes.py Mon May 31 17:45:34 2010 _at_@ -142,10 +142,11 @@ return c.execute("BEGIN") - c.execute("INSERT INTO filearr (path, mirrors) VALUES (%s, '{}')", - [self.src_rel]) - c.execute("SELECT currval('filearr_id_seq')") - file_id = c.fetchone()[0] + if not res_filearr: + c.execute("INSERT INTO filearr (path, mirrors) VALUES (%s, '{}')", + [self.src_rel]) + c.execute("SELECT currval('filearr_id_seq')") + file_id = c.fetchone()[0] c.execute("""INSERT INTO hash (file_id, mtime, size, md5, sha1, sha256, sha1piecesize, _______________________________________________ mirrorbrain-commits mailing list Archive: http://mirrorbrain.org/archive/mirrorbrain-commits/ Note: To remove yourself from this list, send a mail with the content unsubscribe to the address mirrorbrain-commits-request_at_mirrorbrain.orgReceived on Mon May 31 2010 - 15:45:38 GMT
This archive was generated by hypermail 2.3.0 : Mon Feb 20 2012 - 23:47:04 GMT