[PATCH] subrepo: disallow all unknown git ref types

Eric Eisner ede at MIT.EDU
Wed Feb 23 09:18:26 CST 2011


# HG changeset patch
# User Eric Eisner <ede at mit.edu>
# Date 1298474264 18000
# Branch stable
# Node ID b98b3b85f7e2859a4ba25300c860d4bb16a7df26
# Parent  22f948c027a97e640ae74021dfdfd8014717705d
subrepo: disallow all unknown git ref types

diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
--- a/mercurial/subrepo.py
+++ b/mercurial/subrepo.py
@@ -730,7 +730,8 @@ class gitsubrepo(abstractsubrepo):
                                 '%(objectname) %(refname)'])
         for line in out.split('\n'):
             revision, ref = line.split(' ')
-            if ref.startswith('refs/tags/'):
+            if (not ref.startswith('refs/heads/') and
+                not ref.startswith('refs/remotes/')):
                 continue
             if ref.startswith('refs/remotes/') and ref.endswith('/HEAD'):
                 continue # ignore remote/HEAD redirects


More information about the Mercurial-devel mailing list