Repair the URL conf

The URL pattern r'^subdomains(?:/(?P<pkid>\d+))?/$' can match subdomains
list view(app/packagedb/subdomains/) and subdomain detail
view(app/packagedb/subdomains/pkid/), subdomains list view had been removed,
so when user access this url, it will raise 500 server error, not friendly.

In the same way, the read view and update view, for example access subdomains/read/,
it will raise 500 server error and logically, it is wrong url and it will raise 404,
subdomains/pkid/read/ is right, we must point put which subdomain we read.

Fixes: #2179

Change-Id: I077288c901990cf9ab976745e49bd9faf56af9ce
Signed-off-by: gaoxuesx <xuesongx.gao@intel.com>
Add RELEASE_NOTES for version 0.2.1

Change-Id: I82f0e8a6148241019503786785addab42bba5bc4
Signed-off-by: langdaix <langx.dai@intel.com>
Fixes the typo

Change-Id: Ied92c19eb11f5dfaf2d6d99a08a0b263106c2aa0
Signed-off-by: gaoxuesx <xuesongx.gao@intel.com>
Bump devel version to 0.2.2

Change-Id: Icd327ee13066a3dfaf35f306ca9e89d85f8b4268
Signed-off-by: langdaix <langx.dai@intel.com>
Clear all caches when impore new data

Clean all caches when importing scm data to keep cache the same with
database

Change-Id: I2ea970e69016e0d1c78bb664272089596320c543
Fixes: #2181
Change submission status to "Package building" when receive "pre_created" event

The status in submission will be updated by method populate_status()
when receive "pre_created" event. Howerer submissions are found by
SubmissionBuild, so we should create SubmissionBuild first.

And add test cases for this change.

Fixes: #2180
Change-Id: Iebcede084c2b7b3bb87262eb57b8ee810f6b2f6e
Fix deadlock issue in package_built handler

When creating a PackageBuild record, it locks corresponding row
of BuildGroup in shared mode. If two transaction creating two
PackageBuild records of the same BuildGroup record, they both
hold the shared lock. Then when they try to updating BuildGroup
record, deadlock occurs.

The solution is moving updating BuildGroup operation in front of
inserting PackageBuild. Then the second transaction can't get
exclusive lock before the first transaction release(finish).

Also make other improvements as follows:

* save a model only if it's really needed
* restart a transaction if deadlock raised

Refs #2192 for more detail of this deadlock issue.

Refs MYSQL docs for constraint check of foreign key.
http://dev.mysql.com/doc/refman/5.5/en/innodb-foreign-key-constraints.html

Change-Id: I851da850f5faca805cebe81908d443415d06bd8a
Change the scm check error message

The error messages is not precise.
(TREE): Multi tree pathes: [external/avahi, external/acpid]
Change "Multi" to "Duplicated" that will be better.

Fixes: #2155

Change-Id: Ie6c935f5f6de07348cab8256ef000e2fa63e3e32
Signed-off-by: gaoxuesx <xuesongx.gao@intel.com>
Add RELEASE_NOTES for version 0.2.2

Change-Id: I285900a80e423cd91e22fff0bdcd34f05872dda9
Signed-off-by: langdaix <langx.dai@intel.com>