13d4114ac434 — Oben Sonne 10 years ago
Don't break on RepoError

Amongst others a not reeachable remote repository may throw a RepoError
which now gets handled similar to Abort errors. They are logged and - if
configured - trigger a call of the alert tool. Subsequent the command
continues to run.
1 files changed, 2 insertions(+), 1 deletions(-)

M autosync.py
M autosync.py +2 -1
@@ 49,6 49,7 @@ import time
 from mercurial import hg
 from mercurial import commands
 from mercurial import cmdutil
+from mercurial import error
 from mercurial import util
 from hgext.fetch import fetch
 from hgext.fetch import cmdtable as fetch_ct

          
@@ 140,7 141,7 @@ def _sync(ui, repo, other, opts):
         ui.write("%s\n" % (" %s " % ts).center(79, "-"))
         try:
             _cycle(ui, repo.root, commitopts, fetchopts, pushopts)
-        except util.Abort, e:
+        except (util.Abort, error.RepoError), e:
             ui.warn("%s\n" % e)
             ui.warn("sync: an error occurred, will retry at next interval\n")
             _alert(ui, repo, e)