[gnome-continuous] builtin: Require a snapshot path



commit a2ad3b373afce7e1f4ba5c19852845da528080d1
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Sep 30 15:04:42 2013 -0400

    builtin: Require a snapshot path
    
    This removes one unnecessary use of JsonDB.

 src/js/builtin.js |   13 ++-----------
 1 files changed, 2 insertions(+), 11 deletions(-)
---
diff --git a/src/js/builtin.js b/src/js/builtin.js
index cc14040..562bcf8 100644
--- a/src/js/builtin.js
+++ b/src/js/builtin.js
@@ -24,7 +24,6 @@ const GSystem = imports.gi.GSystem;
 const Params = imports.params;
 const JsonUtil = imports.jsonutil;
 const ArgParse = imports.argparse;
-const JsonDB = imports.jsondb;
 const Snapshot = imports.snapshot;
 const BuildUtil = imports.buildutil;
 
@@ -57,16 +56,8 @@ const Builtin = new Lang.Class({
 
     _initSnapshot: function(workdir, snapshotPath, cancellable) {
        this._initWorkdir(workdir, cancellable);
-       let snapshotDir = this.workdir.get_child('snapshots');
-       let path, data;
-       if (snapshotPath !== null) {
-           path = Gio.File.new_for_path(snapshotPath);
-           data = JsonUtil.loadJson(path, cancellable);
-       } else {
-           let db = new JsonDB.JsonDB(snapshotDir);
-           path = db.getLatestPath();
-           data = db.loadFromPath(path, cancellable);
-       }
+       let path = Gio.File.new_for_path(snapshotPath);
+       let data = JsonUtil.loadJson(path, cancellable);
        this._snapshot = new Snapshot.Snapshot(data, path);
     },
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]