comparison mercurial/subrepo.py @ 13465:fa88fabc1d66 stable

subrepo: disallow all unknown git ref types
author Eric Eisner <ede@mit.edu>
date Wed, 23 Feb 2011 10:17:44 -0500
parents 64bb8e586a92
children f2295f7cd468
comparison
equal deleted inserted replaced
13464:da0ddd62b9d8 13465:fa88fabc1d66
728 728
729 out = self._gitcommand(['for-each-ref', '--format', 729 out = self._gitcommand(['for-each-ref', '--format',
730 '%(objectname) %(refname)']) 730 '%(objectname) %(refname)'])
731 for line in out.split('\n'): 731 for line in out.split('\n'):
732 revision, ref = line.split(' ') 732 revision, ref = line.split(' ')
733 if ref.startswith('refs/tags/'): 733 if (not ref.startswith('refs/heads/') and
734 not ref.startswith('refs/remotes/')):
734 continue 735 continue
735 if ref.startswith('refs/remotes/') and ref.endswith('/HEAD'): 736 if ref.startswith('refs/remotes/') and ref.endswith('/HEAD'):
736 continue # ignore remote/HEAD redirects 737 continue # ignore remote/HEAD redirects
737 branch2rev[ref] = revision 738 branch2rev[ref] = revision
738 rev2branch.setdefault(revision, []).append(ref) 739 rev2branch.setdefault(revision, []).append(ref)