Made constructor for pushed snapshot.

This commit is contained in:
Winston Li 2014-11-17 10:13:01 +00:00
parent 7d650a8604
commit c9d773b6e8
2 changed files with 11 additions and 1 deletions

View file

@ -6,6 +6,7 @@ import uk.ac.ic.wlgitbridge.writelatex.api.request.getforversion.SnapshotFile;
import uk.ac.ic.wlgitbridge.writelatex.api.request.getsavedvers.SnapshotInfo;
import uk.ac.ic.wlgitbridge.writelatex.api.request.getsavedvers.WLUser;
import java.util.LinkedList;
import java.util.List;
/**
@ -32,6 +33,15 @@ public class Snapshot implements Comparable<Snapshot> {
atts = data.getAtts();
}
public Snapshot(int versionID) {
this.versionID = versionID;
comment = "Pushed update";
userName = "Anonymous";
userEmail = "anonymous@writelatex.com";
srcs = new LinkedList<SnapshotFile>();
atts = new LinkedList<SnapshotAttachment>();
}
public int getVersionID() {
return versionID;
}

View file

@ -40,7 +40,7 @@ public class WLProject {
}
public void putLatestSnapshot(int versionID) {
snapshots.put(versionID, null);
snapshots.put(versionID, new Snapshot(versionID));
snapshotFetcher.putLatestVersion(versionID);
latestSnapshotID = versionID;
}