Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(15)

Side by Side Diff: lib/codereview/codereview.py

Issue 154140: code review 154140: codereview: add clpatch --ignore_hgpatch_errors. (Closed)
Patch Set: code review 154140: codereview: add clpatch --ignore_hgpatch_errors. Created 15 years, 4 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright 2007-2009 Google Inc. 3 # Copyright 2007-2009 Google Inc.
4 # 4 #
5 # Licensed under the Apache License, Version 2.0 (the "License"); 5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License. 6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at 7 # You may obtain a copy of the License at
8 # 8 #
9 # http://www.apache.org/licenses/LICENSE-2.0 9 # http://www.apache.org/licenses/LICENSE-2.0
10 # 10 #
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after
771 return err 771 return err
772 try: 772 try:
773 cmd = subprocess.Popen(argv, shell=False, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=None, close_fds=True) 773 cmd = subprocess.Popen(argv, shell=False, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=None, close_fds=True)
774 except: 774 except:
775 return "hgpatch: " + ExceptionDetail() 775 return "hgpatch: " + ExceptionDetail()
776 if os.fork() == 0: 776 if os.fork() == 0:
777 cmd.stdin.write(patch) 777 cmd.stdin.write(patch)
778 os._exit(0) 778 os._exit(0)
779 cmd.stdin.close() 779 cmd.stdin.close()
780 out = cmd.stdout.read() 780 out = cmd.stdout.read()
781 » if cmd.wait() != 0: 781 » if cmd.wait() != 0 and not opts["ignore_hgpatch_failure"]:
782 return "hgpatch failed" 782 return "hgpatch failed"
783 cl.local = True 783 cl.local = True
784 cl.files = out.strip().split() 784 cl.files = out.strip().split()
785 files = ChangedFiles(ui, repo, [], opts) 785 files = ChangedFiles(ui, repo, [], opts)
786 extra = Sub(cl.files, files) 786 extra = Sub(cl.files, files)
787 if extra: 787 if extra:
788 ui.warn("warning: these files were listed in the patch but not c hanged:\n\t" + "\n\t".join(extra) + "\n") 788 ui.warn("warning: these files were listed in the patch but not c hanged:\n\t" + "\n\t".join(extra) + "\n")
789 cl.Flush(ui, repo) 789 cl.Flush(ui, repo)
790 ui.write(cl.PendingText() + "\n") 790 ui.write(cl.PendingText() + "\n")
791 791
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
1167 ('d', 'delete', None, 'delete existing change list'), 1167 ('d', 'delete', None, 'delete existing change list'),
1168 ('D', 'deletelocal', None, 'delete locally, but do not c hange CL on server'), 1168 ('D', 'deletelocal', None, 'delete locally, but do not c hange CL on server'),
1169 ('i', 'stdin', None, 'read change list from standard inp ut'), 1169 ('i', 'stdin', None, 'read change list from standard inp ut'),
1170 ('o', 'stdout', None, 'print change list to standard out put'), 1170 ('o', 'stdout', None, 'print change list to standard out put'),
1171 ], 1171 ],
1172 "[-d | -D] [-i] [-o] change# or FILE ..." 1172 "[-d | -D] [-i] [-o] change# or FILE ..."
1173 ), 1173 ),
1174 "^clpatch": ( 1174 "^clpatch": (
1175 clpatch, 1175 clpatch,
1176 [ 1176 [
1177 ('', 'ignore_hgpatch_failure', None, 'create CL metadata even if hgpatch fails'),
1177 ('', 'no_incoming', None, 'disable check for incoming ch anges'), 1178 ('', 'no_incoming', None, 'disable check for incoming ch anges'),
1178 ], 1179 ],
1179 "change#" 1180 "change#"
1180 ), 1181 ),
1181 # Would prefer to call this codereview-login, but then 1182 # Would prefer to call this codereview-login, but then
1182 # hg help codereview prints the help for this command 1183 # hg help codereview prints the help for this command
1183 # instead of the help for the extension. 1184 # instead of the help for the extension.
1184 "code-login": ( 1185 "code-login": (
1185 code_login, 1186 code_login,
1186 [], 1187 [],
(...skipping 1938 matching lines...) Expand 10 before | Expand all | Expand 10 after
3125 3126
3126 3127
3127 def main(): 3128 def main():
3128 try: 3129 try:
3129 RealMain(sys.argv) 3130 RealMain(sys.argv)
3130 except KeyboardInterrupt: 3131 except KeyboardInterrupt:
3131 print 3132 print
3132 StatusUpdate("Interrupted.") 3133 StatusUpdate("Interrupted.")
3133 sys.exit(1) 3134 sys.exit(1)
3134 3135
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b