def cleanup():
    print(green("%s: Cleaning up" % env.host))
    with cd("/home/web2py/applications/eden/"):
        # Remove compiled version of the app
        run("/bin/rm -rf compiled", pty=True)
        # Resolve conflicts
        # @ToDo deal with .moved files
        run("find . -name *.BASE -print | xargs /bin/rm -f", pty=True)
        run("find . -name *.THIS -print | xargs /bin/rm -f", pty=True)
        run("for i in `find . -name *.OTHER` ; do mv $i ${i/.OTHER/}; done", pty=True)
        run("bzr resolve", pty=True)
        # Restore customisations
        print(green("%s: Restoring Customisations" % env.host))
        # @ToDo: Only apply customisations to files which had conflicts
        env.warn_only = True
        run("patch -f -p0 < /root/custom.diff", pty=True)
        env.warn_only = False
Cleanup after the bzr pull
dataset/ETHPy150Open sahana/eden/static/scripts/tools/fabfile.py/cleanup