Skip to content

Instantly share code, notes, and snippets.

@techtonik
Last active December 18, 2015 14:38
Show Gist options
  • Save techtonik/5798245 to your computer and use it in GitHub Desktop.
Save techtonik/5798245 to your computer and use it in GitHub Desktop.
locally - repository checkout w/out moving
# locally recipe that checks out Rietveld sources
# sources go into subdir, because hg is unable to
# checkout into dirty dir. no custom move logic
# is done also
# [ ] check rietveld checkout into given dir
# [ ] check dir/
# [ ] check dir/.hg/
# [ ] check dir/codereview/
# [ ] clone
# --- bootstrap .locally ---
# ROOT - absolute path to bootstrap.py dir, ends
# with /
import os
ROOT = os.path.abspath(os.path.dirname(__file__)) + '/'
# x. check source and clone if needed
HGREMOTE = 'https://code.google.com/p/rietveld/'
HGLOCAL = ROOT + 'rietveld/'
ok = (os.path.exists(HGLOCAL + '.hg') and os.path.isdir(HGLOCAL + 'codereview'))
if ok:
print("Rietveld source code is already downloaded.")
else:
print("Cloninig Rietveld repository..")
cmd = 'hg clone %s %s' % (HGREMOTE, HGLOCAL)
import subprocess
print subprocess.check_output(cmd, shell=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment