##// END OF EJS Templates
fix(mercurial): dropped support for depreacted hgsubversion fixes RCCE-12
super-admin -
r5250:c24343a3 default
parent child Browse files
Show More
@@ -255,23 +255,6 b' class TestAdminSettingsVcs(object):'
255 255 'csrf_token': csrf_token},
256 256 status=404)
257 257
258 def test_extensions_hgsubversion(self, form_defaults, csrf_token):
259 form_defaults.update({
260 'csrf_token': csrf_token,
261 'extensions_hgsubversion': 'True',
262 })
263 response = self.app.post(
264 route_path('admin_settings_vcs_update'),
265 params=form_defaults,
266 status=302)
267
268 response = response.follow()
269 extensions_input = (
270 '<input id="extensions_hgsubversion" '
271 'name="extensions_hgsubversion" type="checkbox" '
272 'value="True" checked="checked" />')
273 response.mustcontain(extensions_input)
274
275 258 def test_extensions_hgevolve(self, form_defaults, csrf_token):
276 259 form_defaults.update({
277 260 'csrf_token': csrf_token,
@@ -378,14 +378,6 b' class DbManage(object):'
378 378
379 379 self.sa.add(lfsstore)
380 380
381 # enable hgsubversion disabled by default
382 hgsubversion = RhodeCodeUi()
383 hgsubversion.ui_section = 'extensions'
384 hgsubversion.ui_key = 'hgsubversion'
385 hgsubversion.ui_value = ''
386 hgsubversion.ui_active = False
387 self.sa.add(hgsubversion)
388
389 381 # enable hgevolve disabled by default
390 382 hgevolve = RhodeCodeUi()
391 383 hgevolve.ui_section = 'extensions'
@@ -1842,6 +1842,11 b' class Config(object):'
1842 1842 def clear_section(self, section):
1843 1843 self._values[section] = {}
1844 1844
1845 def drop_option(self, section, option):
1846 if section not in self._values:
1847 raise ValueError(f'Section {section} does not exist')
1848 del self._values[section][option]
1849
1845 1850 def serialize(self):
1846 1851 """
1847 1852 Creates a list of three tuples (section, key, value) representing
@@ -79,6 +79,13 b' class MercurialRepository(BaseRepository'
79 79 # special requirements
80 80 self.config = config if config else self.get_default_config(
81 81 default=[('extensions', 'largefiles', '')])
82
83 # NOTE(marcink): since python3 hgsubversion is deprecated.
84 # From old installations we might still have this set enabled
85 # we explicitly remove this now here to make sure it wont propagate further
86 if config.get('extensions', 'hgsubversion') is not None:
87 config.drop_option('extensions', 'hgsubversion')
88
82 89 self.with_wire = with_wire or {"cache": False} # default should not use cache
83 90
84 91 self._init_repo(create, src_url, do_workspace_checkout)
@@ -444,7 +444,6 b' def ApplicationUiSettingsForm(localizer)'
444 444 vcs_git_lfs_store_location = All(
445 445 v.ValidPath(localizer),
446 446 v.UnicodeString(strip=True, min=2, not_empty=True))
447 extensions_hgsubversion = v.StringBoolean(if_missing=False)
448 447 extensions_hggit = v.StringBoolean(if_missing=False)
449 448 new_svn_branch = v.ValidSvnPattern(localizer, section='vcs_svn_branch')
450 449 new_svn_tag = v.ValidSvnPattern(localizer, section='vcs_svn_tag')
@@ -488,7 +488,6 b' class VcsSettingsModel(object):'
488 488 ('extensions', 'largefiles'),
489 489 ('largefiles', 'usercache'),
490 490 ('phases', 'publish'),
491 ('extensions', 'hgsubversion'),
492 491 ('extensions', 'evolve'),
493 492 ('extensions', 'topic'),
494 493 ('experimental', 'evolution'),
@@ -672,10 +671,11 b' class VcsSettingsModel(object):'
672 671 self.repo_settings, *phases, value=safe_str(data[phases_key]))
673 672
674 673 def create_or_update_global_hg_settings(self, data):
675 largefiles, largefiles_store, phases, hgsubversion, evolve \
676 = self.GLOBAL_HG_SETTINGS[:5]
677 largefiles_key, largefiles_store_key, phases_key, subversion_key, evolve_key \
678 = self._get_settings_keys(self.GLOBAL_HG_SETTINGS[:5], data)
674 opts_len = 4
675 largefiles, largefiles_store, phases, evolve \
676 = self.GLOBAL_HG_SETTINGS[:opts_len]
677 largefiles_key, largefiles_store_key, phases_key, evolve_key \
678 = self._get_settings_keys(self.GLOBAL_HG_SETTINGS[:opts_len], data)
679 679
680 680 self._create_or_update_ui(
681 681 self.global_settings, *largefiles, value='',
@@ -685,8 +685,6 b' class VcsSettingsModel(object):'
685 685 self._create_or_update_ui(
686 686 self.global_settings, *phases, value=safe_str(data[phases_key]))
687 687 self._create_or_update_ui(
688 self.global_settings, *hgsubversion, active=data[subversion_key])
689 self._create_or_update_ui(
690 688 self.global_settings, *evolve, value='',
691 689 active=data[evolve_key])
692 690 self._set_evolution(self.global_settings, is_enabled=data[evolve_key])
@@ -121,15 +121,6 b''
121 121 <div class="label">
122 122 <span class="help-block">${_('When this is enabled all commits in the repository are seen as public commits by clients.')}</span>
123 123 </div>
124 % if display_globals:
125 <div class="checkbox">
126 ${h.checkbox('extensions_hgsubversion' + suffix,'True')}
127 <label for="extensions_hgsubversion${suffix}">${_('Enable hgsubversion extension')}</label>
128 </div>
129 <div class="label">
130 <span class="help-block">${_('Requires hgsubversion library to be installed. Allows cloning remote SVN repositories and migrates them to Mercurial type.')}</span>
131 </div>
132 % endif
133 124
134 125 <div class="checkbox">
135 126 ${h.checkbox('extensions_evolve' + suffix, 'True', **kwargs)}
@@ -605,7 +605,6 b' class TestCreateOrUpdateGlobalHgSettings'
605 605 'extensions_largefiles': False,
606 606 'largefiles_usercache': '/example/largefiles-store',
607 607 'phases_publish': False,
608 'extensions_hgsubversion': False,
609 608 'extensions_evolve': False
610 609 }
611 610
@@ -619,7 +618,6 b' class TestCreateOrUpdateGlobalHgSettings'
619 618 mock.call(model.global_settings, 'extensions', 'largefiles', active=False, value=''),
620 619 mock.call(model.global_settings, 'largefiles', 'usercache', value='/example/largefiles-store'),
621 620 mock.call(model.global_settings, 'phases', 'publish', value='False'),
622 mock.call(model.global_settings, 'extensions', 'hgsubversion', active=False),
623 621 mock.call(model.global_settings, 'extensions', 'evolve', active=False, value=''),
624 622 mock.call(model.global_settings, 'experimental', 'evolution', active=False, value=''),
625 623 mock.call(model.global_settings, 'experimental', 'evolution.exchange', active=False, value='no'),
General Comments 0
You need to be logged in to leave comments. Login now