Files @ 8fbcdfe364d4
Branch filter:

Location: kallithea/scripts/whitespacecleanup.sh

Mads Kiilerich
tests: make test_forks teardown more stable

It would sometimes fail like:

kallithea/tests/functional/test_forks.py:35: in teardown_method
Session().delete(self.u1)
data/env/lib/python2.7/site-packages/sqlalchemy/orm/session.py:1871: in delete
self._delete_impl(state, instance, head=True)
data/env/lib/python2.7/site-packages/sqlalchemy/orm/session.py:1888: in _delete_impl
self.identity_map.add(state)
data/env/lib/python2.7/site-packages/sqlalchemy/orm/identity.py:149: in add
orm_util.state_str(state), state.key))
E InvalidRequestError: Can't attach instance <User at 0x7f93d2f81a10>; another instance with key (<class 'kallithea.model.db.User'>, (10,), None) is already present in this session.
#!/bin/bash -x

# Enforce some consistency in whitespace - just to avoid spurious whitespaces changes

files=`hg mani | egrep -v '/fontello/|/email_templates/|(/lockfiles.py|^LICENSE-MERGELY.html|^docs/Makefile|^scripts/whitespacecleanup.sh|/(graph|mergely|native.history)\.js|/test_dump_html_mails.ref.html|\.png|\.gif|\.ico|\.pot|\.po|\.mo|\.tar\.gz|\.diff)$'`

sed -i "s/`printf '\r'`//g" $files
sed -i -e "s,`printf '\t'`,    ,g" $files
sed -i -e "s,  *$,,g" $files
sed -i -e 's,\([^ ]\)\\$,\1 \\,g' -e 's,\(["'"'"']["'"'"']["'"'"']\) \\$,\1\\,g' $files
# ensure one trailing newline - remove empty last line and make last line include trailing newline:
sed -i -e '$,${/^$/d}' -e '$a\' $files

sed -i -e 's,\([^ /]\){,\1 {,g' `hg loc '*.css'`
sed -i -e 's|^\([^ /].*,\)\([^ ]\)|\1 \2|g' `hg loc '*.css'`

hg mani | xargs chmod -x
hg loc 'set:!binary()&grep("^#!")&!(**_tmpl.py)&!(**/template**)' | xargs chmod +x

hg diff