Patchwork [2,of,2,V2] subrepo: add _gitmissing checks where needed

login
register
mail settings
Submitter Mathias De Maré
Date Feb. 26, 2015, 6:50 p.m.
Message ID <d04da423afaf121d7cd1.1424976622@mathias-1015PE>
Download mbox | patch
Permalink /patch/7839/
State Superseded
Headers show

Comments

Mathias De Maré - Feb. 26, 2015, 6:50 p.m.
# HG changeset patch
# User Mathias De Maré <mathias.demare@gmail.com>
# Date 1424847016 -3600
#      Wed Feb 25 07:50:16 2015 +0100
# Node ID d04da423afaf121d7cd19dfbac86097609f6563e
# Parent  ad021801d5dcef705a942c638430cf1a83ef2e4d
subrepo: add _gitmissing checks where needed

Some commands did not yet check if the git repository was present.

Patch

diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
--- a/mercurial/subrepo.py
+++ b/mercurial/subrepo.py
@@ -1602,6 +1602,8 @@ 
 
     @annotatesubrepoerror
     def cat(self, match, prefix, **opts):
+        if self._gitmissing():
+            return 1
         rev = self._state[1]
         if match.anypats():
             return 1 #No support for include/exclude yet
@@ -1659,6 +1661,8 @@ 
 
     @annotatesubrepoerror
     def diff(self, ui, diffopts, node2, match, prefix, **opts):
+        if self._gitmissing():
+            return
         node1 = self._state[1]
         cmd = ['diff']
         if opts['stat']: