Mercurial > hg > config
comparison python/applyrealhard.py @ 521:c4432bd3cb9b
wip
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Sat, 21 Sep 2013 14:31:04 -0700 |
parents | 3281b9fe4433 |
children |
comparison
equal
deleted
inserted
replaced
520:3281b9fe4433 | 521:c4432bd3cb9b |
---|---|
26 # TODO: not call out to find | 26 # TODO: not call out to find |
27 return find(directory, '*.rej') | 27 return find(directory, '*.rej') |
28 | 28 |
29 def main(args=sys.argv[1:]): | 29 def main(args=sys.argv[1:]): |
30 | 30 |
31 # parse command line args | |
31 usage = '%prog [options]' | 32 usage = '%prog [options]' |
32 parser = optparse.OptionParser(usage=usage, description=__doc__) | 33 parser = optparse.OptionParser(usage=usage, description=__doc__) |
33 parser.add_option('-d', '--directory', default=os.getcwd()) | 34 parser.add_option('-d', '--directory', default=os.getcwd()) |
34 options, args = parser.parse_args(args) | 35 options, args = parser.parse_args(args) |
36 | |
37 # sanity check | |
38 if not wiggle: | |
39 parser.error("Need wiggle") | |
35 | 40 |
36 # get rejects | 41 # get rejects |
37 rej = rejects(options.directory) | 42 rej = rejects(options.directory) |
38 if not rej: | 43 if not rej: |
39 parser.error("No rejects") | 44 parser.error("No rejects") |
40 print 'rej:\n%s\n' % '\n'.join([' %s' % r for r in rej]) | 45 print 'rej:\n%s\n' % '\n'.join([' %s' % r for r in rej]) |
41 | 46 |
47 # get the originals | |
48 orig = [] | |
42 for r in rej: | 49 for r in rej: |
43 # find the corresponding file | 50 # find the corresponding file |
44 pass | 51 o = r.rsplit('.rej')[0] |
52 if not os.path.exists(o): | |
53 parser.error("%s not found") | |
54 orig.append(o) | |
55 | |
56 # try to wiggle them | |
45 | 57 |
46 if __name__ == '__main__': | 58 if __name__ == '__main__': |
47 main() | 59 main() |