[Updated] [+ ] D9462: chgserver: catch RepoError while loading configuration

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Wed Dec 2 07:43:10 UTC 2020


pulkit updated this revision to Diff 23927.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D9462?vs=23873&id=23927

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D9462/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D9462

AFFECTED FILES
  mercurial/chgserver.py

CHANGE DETAILS

diff --git a/mercurial/chgserver.py b/mercurial/chgserver.py
--- a/mercurial/chgserver.py
+++ b/mercurial/chgserver.py
@@ -504,10 +504,21 @@
         the instructions.
         """
         args = self._readlist()
+        errorraised = False
         try:
             self.ui, lui = _loadnewui(self.ui, args, self.cdebug)
+        except error.RepoError as inst:
+            # RepoError can be raised while trying to read shared source
+            # configuration
+            self.ui.error(_(b"abort: %s\n") % stringutil.forcebytestr(inst))
+            if inst.hint:
+                self.ui.error(_(b"(%s)\n") % inst.hint)
+            errorraised = True
         except error.Abort as inst:
             self.ui.error(inst.format())
+            errorraised = True
+
+        if errorraised:
             self.ui.flush()
             self.cresult.write(b'exit 255')
             return



To: pulkit, #hg-reviewers, marmoute
Cc: mharbison72, marmoute, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20201202/02a31679/attachment.html>


More information about the Mercurial-patches mailing list