예제 #1
0
 @Override
 public void delete(FileSystemPage page) {
   Repository repository = getRepository(page);
   Git git = new Git(repository);
   String fileSystemPath = getPath(page, repository);
   try {
     git.rm()
         .addFilepattern(fileSystemPath + "/" + contentFilename)
         .addFilepattern(fileSystemPath + "/" + propertiesFilename)
         .call();
     commit(
         git,
         String.format(
             "FitNesse page %s deleted.", PathParser.render(page.getPageCrawler().getFullPath())));
   } catch (Exception e) {
     throw new RuntimeException(e);
   }
   persistence.delete(page);
 }
예제 #2
0
 @Override
 public VersionInfo makeVersion(FileSystemPage page, PageData data) {
   persistence.makeVersion(page, data);
   Repository repository = getRepository(page);
   Git git = new Git(repository);
   String fileSystemPath = getPath(page, repository);
   try {
     git.add()
         .addFilepattern(fileSystemPath + "/" + contentFilename)
         .addFilepattern(fileSystemPath + "/" + propertiesFilename)
         .call();
     commit(
         git,
         String.format(
             "FitNesse page %s updated.", PathParser.render(page.getPageCrawler().getFullPath())));
   } catch (Exception e) {
     throw new RuntimeException(e);
   }
   return getCurrentVersion(repository);
 }