Lively Kernel canvas
listRevisions = function(worldName) {
// list revisions of a file
if (!worldName.endsWith('.xhtml'))
worldName += '.xhtml';
file = worldName;
url = URL.source.getDirectory();
dir = new FileDirectory(url);
res = new SVNResource(url.toString(), Record.newPlainInstance({URL: url+file, Metadata: null, HeadRevision: null}));
res.fetchMetadata(true, null);
timestamps = res.getMetadata();
revs = timestamps.collect(function(ea) { return ea.toString().match(/.*Revision (.*)/)[1] });
return revs;
}
revertWorld = function(worldName, revision) {
// revert a file to a revision
if (!worldName.endsWith('.xhtml'))
worldName += '.xhtml';
file = worldName;
dir = new FileDirectory(URL.source);
content = dir.fileContent(file, revision);
return dir.writeFileNamed(file, content)
}
null
null
false
null
//replaceindexwiththenameofyourworldthenselectthewholetext//andpressalt+ptogetallrevisionsofyourworldmyWorld='index';listRevisions(myWorld)
1
null
true
true
false
72
false
null
0
null
true
false
false
1
true
false
true
false
null
false
null
false
null
false
1
null
false
false
false
false
null
false
false
null
null
null
null
false
null
false
null
//entertherevisiontowhichyourworldshouldbe//revertedbelow,selectthewholetextandpressalt+drevision=12345;revertWorld(myWorld,revision)
3
true
true
false
55
true
null
87
null
true
false
false
1
true
false
true
false
null
false
null
false
null
false
1
null
false
false
false
false
null
false
false
null
null
null
null
false
null
1235293741167
119206
1
11
null
1235293741
null