Examples of HgBookmarks


Examples of org.tmatesoft.hg.repo.HgBookmarks

    System.out.printf("collapse:%b, keep:%b, keepbranches:%b\n", re.isCollapse(), re.isKeepOriginalRevisions(), re.isKeepBranchNames());
  }
 
  // TODO as test
  private void dumpBookmarks() throws Exception {
    HgBookmarks bm = hgRepo.getBookmarks();
    String active = bm.getActiveBookmarkName();
    ArrayList<String> all = new ArrayList<String>(bm.getAllBookmarks());
    Collections.sort(all);
    for (String bmname : all) {
      if (bmname.equals(active)) {
        System.out.print(" * ");
      } else {
        System.out.print("   ");
      }
      System.out.printf("%-26s (%s)\n", bmname, bm.getRevision(bmname).shortNotation());
    }
  }
View Full Code Here

Examples of org.tmatesoft.hg.repo.HgBookmarks

      assertEquals(commitCmd.getCommittedRevision(), srcRepo.getBookmarks().getRevision(bm1));
      //
      new HgPushCommand(srcRepo).destination(dstRemote).execute();
      Thread.sleep(300); // let the server perform the update
      //
      HgBookmarks srcBookmarks = srcRepo.getBookmarks();
      final HgChangelog srcClog = srcRepo.getChangelog();
      // first, check local bookmarks are intact
      errorCollector.assertEquals(srcClog.getRevision(bm2Local), srcBookmarks.getRevision(bm2));
      errorCollector.assertEquals(srcClog.getRevision(bm3Local), srcBookmarks.getRevision(bm3));
      errorCollector.assertEquals(null, srcBookmarks.getRevision(bm4));
      errorCollector.assertEquals(srcClog.getRevision(bm_4_5), srcBookmarks.getRevision(bm5));
      // now, check remote bookmarks were touched
      HgRepository dstRepo = hgLookup.detect(dstRepoLoc);
      HgBookmarks dstBookmarks = dstRepo.getBookmarks();
      final HgChangelog dstClog = dstRepo.getChangelog();
      // bm1 changed and points to newly pushed commit.
      // if the test fails (bm1 points to r8), chances are server didn't manage to update
      // bookmarks yet (there's Thread.sleep() above to give it a chance).
      errorCollector.assertEquals(commitCmd.getCommittedRevision(), dstBookmarks.getRevision(bm1));
      // bm2 didn't change
      errorCollector.assertEquals(dstClog.getRevision(bm2Remote), dstBookmarks.getRevision(bm2));
      // bm3 did change, now points to value we've got in srcRepo
      errorCollector.assertEquals(srcClog.getRevision(bm3Local), dstBookmarks.getRevision(bm3));
      // bm4 is not affected
      errorCollector.assertEquals(dstClog.getRevision(bm_4_5), dstBookmarks.getRevision(bm4));
      // bm5 is not known remotely
      errorCollector.assertEquals(null, dstBookmarks.getRevision(bm5));
    } finally {
      server.stop();
    }
  }
View Full Code Here

Examples of org.tmatesoft.hg.repo.HgBookmarks

        }
      }
      progress.worked(5);
      //
      // update bookmark information
      HgBookmarks localBookmarks = repo.getBookmarks();
      if (!localBookmarks.getAllBookmarks().isEmpty()) {
        for (Pair<String,Nodeid> bm : remoteRepo.getBookmarks()) {
          Nodeid localRevision = localBookmarks.getRevision(bm.first());
          if (localRevision == null || !parentHelper.knownNode(bm.second())) {
            continue;
          }
          // we know both localRevision and revision of remote bookmark,
          // need to make sure we don't push  older revision than it's at the server
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.