(opts, extra_args) = parser.parse_args()
+if opts.email is None and os.getenv("EMAIL") is not None:
+ opts.email = os.getenv("EMAIL")
+
+if opts.email:
+ print "Sending email to %s" % opts.email
+
if not opts.foreground and not opts.email:
print "Not running in foreground and --email not specified."
sys.exit(1)
if not opts.foreground and opts.push_master:
- print "Unable to push to master when not running in foreground."
- sys.exit(1)
+ print "Pushing to master, forcing run in foreground."
+ opts.foreground = True
if not opts.remote_repo:
print "%s$ mktemp -d" % opts.host
sys.exit(1)
remote_repo = stdout.rstrip()
print "Remote tempdir: %s" % remote_repo
- # Bootstrap, git.samba.org is close to sn-devel
- remote_args = ["git", "clone", samba_master, remote_repo]
+ # Bootstrap, git.samba.org is usually more easily accessible.
+ #remote_args = ["git", "clone", samba_master, remote_repo]
+ remote_args = ["if [ -d /data/git/samba.git ]; then git clone --shared /data/git/samba.git %s; else git clone --shared %s %s; fi" % (remote_repo, samba_master, remote_repo)]
#remote_args = ["git", "init", remote_repo]
print "%s$ %s" % (opts.host, " ".join(remote_args))
subprocess.check_call(["ssh", opts.host] + remote_args)
print "$ " + " ".join(args)
subprocess.check_call(args)
remote_args = ["cd", remote_repo, ";", "git", "checkout", "land", ";", "python", "-u", "./script/land.py", "--repository=%s" % remote_repo]
+
+if (opts.email and not (opts.foreground or opts.pushto or opts.push_master)):
+ # Force always emailing if there's nothing else to do
+ opts.always_email = True
+
if opts.email:
remote_args.append("--email=%s" % opts.email)
if opts.always_email:
remote_args.append("--pushto=%s" % opts.pushto)
if opts.push_master:
remote_args.append("--push-master")
+if opts.fail_slowly:
+ remote_args.append("--fail-slowly")
remote_args += extra_args
print "%s$ %s" % (opts.host, " ".join(remote_args))