merge two default heads
authorJulien Cristau <julien.cristau@logilab.fr>
Wed, 07 Jan 2015 14:07:17 +0100
changeset 10135 52e011d08675
parent 10132 5af4c5087d32 (current diff)
parent 10130 ae518e501179 (diff)
child 10136 c33dcd18e0bb
merge two default heads
skeleton/debian/rules.tmpl
--- a/server/migractions.py	Wed Jan 07 11:55:12 2015 +0100
+++ b/server/migractions.py	Wed Jan 07 14:07:17 2015 +0100
@@ -1061,12 +1061,9 @@
 
     def cmd_drop_relation_type(self, rtype, commit=True):
         """unregister an existing relation type"""
-        rschema = self.repo.schema[rtype]
-        if rschema.rule:
-            etype = 'CWComputedRType'
-        else:
-            etype = 'CWRType'
-        self.rqlexec('DELETE %s X WHERE X name %r' % (etype, rtype),
+        self.rqlexec('DELETE CWRType X WHERE X name %r' % rtype,
+                     ask_confirm=self.verbosity>=2)
+        self.rqlexec('DELETE CWComputedRType X WHERE X name %r' % rtype,
                      ask_confirm=self.verbosity>=2)
         if commit:
             self.commit()
--- a/server/test/unittest_migractions.py	Wed Jan 07 11:55:12 2015 +0100
+++ b/server/test/unittest_migractions.py	Wed Jan 07 14:07:17 2015 +0100
@@ -309,6 +309,8 @@
             self.assertEqual(self.schema['filed_under2'].objects(), ('Folder2',))
             mh.cmd_drop_relation_type('filed_under2')
             self.assertNotIn('filed_under2', self.schema)
+            # this should not crash
+            mh.cmd_drop_relation_type('filed_under2')
 
     def test_add_relation_definition_nortype(self):
         with self.mh() as (cnx, mh):
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/skeleton/debian/rules	Wed Jan 07 14:07:17 2015 +0100
@@ -0,0 +1,14 @@
+#!/usr/bin/make -f
+
+export NO_SETUPTOOLS=1
+
+%:
+	dh $@ --with python2
+
+override_dh_auto_install:
+	dh_auto_install
+	# remove generated .egg-info file
+	rm -rf debian/*/usr/lib/python*
+
+override_dh_python2:
+	dh_python2 -i /usr/share/cubicweb
--- a/skeleton/debian/rules.tmpl	Wed Jan 07 11:55:12 2015 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-#!/usr/bin/make -f
-# Sample debian/rules that uses debhelper.
-# GNU copyright 1997 to 1999 by Joey Hess.
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-build: build-arch build-indep
-build-arch:
-	# Nothing to do
-build-indep: build-stamp
-build-stamp:
-	dh_testdir
-	NO_SETUPTOOLS=1 python setup.py -q build
-	touch build-stamp
-
-clean:
-	dh_testdir
-	rm -f build-stamp configure-stamp
-	rm -rf build
-	find . -name "*.pyc" -delete
-	dh_clean
-
-install: build
-	dh_testdir
-	dh_testroot
-	dh_clean -k
-	dh_installdirs -i
-	NO_SETUPTOOLS=1 python setup.py -q install --no-compile --prefix=debian/%(distname)s/usr/
-	# remove generated .egg-info file
-	rm -rf debian/%(distname)s/usr/lib/python*
-
-
-# Build architecture-independent files here.
-binary-indep: build install
-	dh_testdir
-	dh_testroot
-	dh_install -i
-	dh_installchangelogs -i
-	dh_installexamples -i
-	dh_installdocs -i README
-	dh_installman -i
-	dh_python2 -i /usr/share/cubicweb
-	dh_link -i
-	dh_compress -i -X.py -X.ini -X.xml -Xtest
-	dh_fixperms -i
-	dh_installdeb -i
-	dh_gencontrol -i
-	dh_md5sums -i
-	dh_builddeb -i
-
-
-# Build architecture-dependent files here.
-binary-arch:
-
-binary: binary-indep
-.PHONY: build clean binary-arch binary-indep binary