summaryrefslogtreecommitdiffstats
path: root/dartium_tools/update_patched_files.py
blob: 37e9543a49dd614b2b9f013ca5716bd22904900a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env python
#
# Copyright 2012 Google Inc. All Rights Reserved.

import overrides_database
import shutil
import subprocess
import sys


def svn_update(path, rev):
  subprocess.call(['svn', 'up', '-r', str(rev), path])


def update_overridden_files(old_rev, new_rev):
  assert old_rev < new_rev
  for override in overrides_database.OVERRIDDEN_FILES:
    patched = override['modified']
    orig = override['original']
    svn_update(orig, old_rev)
    shutil.copyfile(patched, orig)
    svn_update(orig, new_rev)
    shutil.copyfile(orig, patched)


if __name__ == '__main__':
  update_overridden_files(int(sys.argv[1]), int(sys.argv[2]))