comparison tests/test_tags.py @ 1439:ab15749252b0

TagMap: stop automagically running 'hg svn rebuildmeta' This resolves a layering violation that was causing us to hang on to a repo reference via meta. We don't change maps often enough to justify this.
author Augie Fackler <raf@durin42.com>
date Sun, 05 Jun 2016 23:01:46 -0400
parents a36e87ae2380
children 9a6bb3657861
comparison
equal deleted inserted replaced
1438:59d4b24a0f47 1439:ab15749252b0
2 2
3 import os, sys, cStringIO, difflib 3 import os, sys, cStringIO, difflib
4 import unittest 4 import unittest
5 5
6 from mercurial import commands 6 from mercurial import commands
7 from mercurial import error
7 from mercurial import hg 8 from mercurial import hg
8 from mercurial import node 9 from mercurial import node
9 from mercurial import ui 10 from mercurial import ui
10 11
11 from hgsubversion import compathacks 12 from hgsubversion import compathacks
162 tags, 163 tags,
163 {'magic': '\xa2b\xb9\x03\xc6\xbd\x903\x95\xf5\x0f\x94\xcey\xc4E\xfaE6\xaa', 164 {'magic': '\xa2b\xb9\x03\xc6\xbd\x903\x95\xf5\x0f\x94\xcey\xc4E\xfaE6\xaa',
164 'magic2': '\xa3\xa2D\x86aM\xc0v\xb9\xb0\x18\x14\xad\xacwBUi}\xe2', 165 'magic2': '\xa3\xa2D\x86aM\xc0v\xb9\xb0\x18\x14\xad\xacwBUi}\xe2',
165 }) 166 })
166 167
167 def test_old_tag_map_rebuilds(self): 168 def test_old_tag_map_aborts(self):
168 repo = self._load_fixture_and_fetch('tag_name_same_as_branch.svndump') 169 repo = self._load_fixture_and_fetch('tag_name_same_as_branch.svndump')
169 tm = os.path.join(repo.path, 'svn', 'tagmap') 170 tm = os.path.join(repo.path, 'svn', 'tagmap')
170 open(tm, 'w').write('1\n') 171 open(tm, 'w').write('1\n')
171 # force tags to load since it is lazily loaded when needed 172 # force tags to load since it is lazily loaded when needed
172 repo.svnmeta().tags 173 self.assertRaises(error.Abort, lambda: repo.svnmeta().tags)
173 commands.pull(repo.ui, repo)
174 self.assertEqual(open(tm).read().splitlines()[0], '2')
175 174
176 def _debug_print_tags(self, repo, ctx, fp): 175 def _debug_print_tags(self, repo, ctx, fp):
177 def formatnode(ctx): 176 def formatnode(ctx):
178 crev = ctx.extra().get('convert_revision', 'unk/unk@unk') 177 crev = ctx.extra().get('convert_revision', 'unk/unk@unk')
179 path, rev = crev.rsplit('@', 1) 178 path, rev = crev.rsplit('@', 1)