def pull():
    print(green("%s: Upgrading code" % env.host))
    with cd("/home/web2py/applications/eden/"):
        try:
            print(green("%s: Upgrading to version %i" % (env.host, env.revno)))
            run("bzr pull -r %i" % env.revno, pty=True)
        except:
            if not env.tested:
                # Upgrade to current Trunk
                print(green("%s: Upgrading to current Trunk" % env.host))
                run("bzr pull", pty=True)
            else:
                # work out the VERSION to pull
                print(green("%s: Getting the version to update to" % env.host))
                run("scp -i /root/.ssh/sahana_release %s@%s:/home/web2py/applications/eden/VERSION /root/VERSION_test" % (env.user, test_host), pty=True)
                version = run("cat /root/VERSION_test", pty=True)
                env.revno = int(version.split(" ")[0].replace("r", ""))
                print(green("%s: Upgrading to version %i" % (env.host, env.revno)))
                run("bzr pull -r %i" % env.revno, pty=True)
Upgrade the Eden code
dataset/ETHPy150Open sahana/eden/static/scripts/tools/fabfile.py/pull