git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v3 02/10] remote-hg: get rid of unused exception checks

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
May 13, 2013, 23:11 UTC
Message-ID
<1368486720-2716-3-git-send-email-felipe.contreras@gmail.com>
In-Reply-To
<1368486720-2716-1-git-send-email-felipe.contreras@gmail.com>
We are not calling check_output() anymore.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 contrib/remote-helpers/git-remote-hg | 24 +++++++++---------------
 1 file changed, 9 insertions(+), 15 deletions(-)
diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg
index d33c7ba..9d6940b 100755
--- a/contrib/remote-helpers/git-remote-hg
+++ b/contrib/remote-helpers/git-remote-hg
@@ -327,11 +327,8 @@ def get_repo(url, alias):
     myui.setconfig('ui', 'interactive', 'off')
     myui.fout = sys.stderr
 
-    try:
-        if get_config('remote-hg.insecure') == 'true\n':
-            myui.setconfig('web', 'cacerts', '')
-    except subprocess.CalledProcessError:
-        pass
+    if get_config('remote-hg.insecure') == 'true\n':
+        myui.setconfig('web', 'cacerts', '')
 
     try:
         mod = extensions.load(myui, 'hgext.schemes', None)
@@ -910,16 +907,13 @@ def main(args):
     track_branches = True
     force_push = True
 
-    try:
-        if get_config('remote-hg.hg-git-compat') == 'true\n':
-            hg_git_compat = True
-            track_branches = False
-        if get_config('remote-hg.track-branches') == 'false\n':
-            track_branches = False
-        if get_config('remote-hg.force-push') == 'false\n':
-            force_push = False
-    except subprocess.CalledProcessError:
-        pass
+    if get_config('remote-hg.hg-git-compat') == 'true\n':
+        hg_git_compat = True
+        track_branches = False
+    if get_config('remote-hg.track-branches') == 'false\n':
+        track_branches = False
+    if get_config('remote-hg.force-push') == 'false\n':
+        force_push = False
 
     if hg_git_compat:
         mode = 'hg'
-- 
1.8.3.rc1.579.g184e698
Previous: Felipe ContrerasNext: Felipe Contreras
Message 4 of 41 in “remote-hg: fixes and cleanups”
  1. 00/10 remote-hg: fixes and cleanupsFelipe Contreras, May 13, 2013
  2. 01/10 remote-hg: trivial cleanupsFelipe Contreras, May 13, 2013
  3. Felipe ContrerasMay 14, 2013
  4. 02/10 remote-hg: get rid of unused exception checksFelipe Contreras, May 13, 2013
  5. Felipe ContrerasMay 14, 2013
  6. 03/10 remote-hg: enable track-branches in hg-git modeFelipe Contreras, May 13, 2013
  7. Felipe ContrerasMay 14, 2013
  8. 04/10 remote-hg: add new get_config_bool() helperFelipe Contreras, May 13, 2013
  9. Felipe ContrerasMay 14, 2013
  10. 05/10 remote-hg: fix new branch creationFelipe Contreras, May 13, 2013
  11. Felipe ContrerasMay 14, 2013
  12. Junio C HamanoMay 15, 2013
  13. Felipe ContrerasMay 15, 2013
  14. 06/10 remote-hg: disable forced push by defaultFelipe Contreras, May 13, 2013
  15. Felipe ContrerasMay 14, 2013
  16. 07/10 remote-hg: don't push fake 'master' bookmarkFelipe Contreras, May 13, 2013
  17. Felipe ContrerasMay 14, 2013
  18. 08/10 remote-hg: update bookmarks when pullingFelipe Contreras, May 13, 2013
  19. Felipe ContrerasMay 14, 2013
  20. Junio C HamanoMay 14, 2013
  21. Felipe ContrerasMay 14, 2013
  22. Junio C HamanoMay 14, 2013
  23. Felipe ContrerasMay 14, 2013
  24. Junio C HamanoMay 14, 2013
  25. Felipe ContrerasMay 14, 2013
  26. Junio C HamanoMay 14, 2013
  27. Felipe ContrerasMay 14, 2013
  28. 09/10 remote-hg: test: be a little more quietFelipe Contreras, May 13, 2013
  29. Felipe ContrerasMay 14, 2013
  30. Junio C HamanoMay 14, 2013
  31. Felipe ContrerasMay 14, 2013
  32. 10/10 remote-hg: trivial reorganizationFelipe Contreras, May 13, 2013
  33. Felipe ContrerasMay 14, 2013
  34. Junio C HamanoMay 14, 2013
  35. Felipe ContrerasMay 14, 2013
  36. Junio C HamanoMay 14, 2013
  37. Junio C HamanoMay 14, 2013
  38. Felipe ContrerasMay 14, 2013
  39. Felipe ContrerasMay 14, 2013
  40. Junio C HamanoMay 14, 2013
  41. Felipe ContrerasMay 14, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.