Esempio n. 1
0
def _cycle(ui, root, commitopts, fetchopts, pushopts):
    """Run a single 'commit, fetch, push' cycle"""

    repo = hg.repository(ui, path=root)
    ui.status("sync: commit working copy changes\n")
    commands.commit(ui, repo, **commitopts)
    ui.status("sync: fetch changes from other repository\n")
    fetch(ui, repo, **fetchopts)
    ui.status("sync: push local changes to other repository\n")
    commands.push(ui, repo, **pushopts)
Esempio n. 2
0
 def function(tree, srcpath, opts):
     if not srcpath:
         srcpath = forest.top().getpath(source)
         if srcpath:
             rpath = util.pconvert(relpath(forest.top().root, tree.root))
             srcpath = '/'.join((srcpath, rpath))
         else:
             ui.warn(_("skipped: %s\n") %
                     _("repository %s not found") % source[0])
             return
     try:
         fetch.fetch(ui, tree.getrepo(ui), srcpath, **opts)
     except Exception, err:
         ui.warn(_("skipped: %s\n") % err)
         tree.repo.transaction().__del__()