Reviewers: felix8a,
Description:
This ensures that security patches are not accidentally made public by
committing them to the repository.
Fixes <https://code.google.com/p/google-caja/issues/detail?id=1853>.
Please review this at https://codereview.appspot.com/13604048/
Affected files (+22, -1 lines):
M tools/appspot.py
M tools/myvn
Index: tools/myvn
===================================================================
--- tools/myvn (revision 5599)
+++ tools/myvn (working copy)
@@ -112,7 +112,16 @@
"$tools_dir/appspot.py" edit "$@"
;;
submit )
- runAntTests && "$svn" commit -F <("$tools_dir/appspot.py" show "$@")
&& tidyup
+ if "$tools_dir/appspot.py" fail-if-private "$@"; then
+ runAntTests && \
+ "$svn" commit -F <("$tools_dir/appspot.py" show "$@") && \
+ tidyup
+ else
+ echo Change is flagged as Private. Remove the Private flag before \
+ committing
+ echo to the public repository.
+ exit 1
+ fi
;;
tidyup )
tidyup
Index: tools/appspot.py
===================================================================
--- tools/appspot.py (revision 5599)
+++ tools/appspot.py (working copy)
@@ -341,6 +341,14 @@
print readable_change(current_cl)
+def do_fail_if_private(given_cl, current_cl):
+ given_cl.merge_into(current_cl)
+ if current_cl.private:
+ sys.exit(1)
+ else:
+ sys.exit(0)
+
+
def do_snapshot(given_cl, current_cl, cl_file_path, send_mail):
if not given_cl.is_unspecified():
given_cl.merge_into(current_cl)
@@ -500,6 +508,10 @@
do_snapshot(
given_cl=given_cl, current_cl=current_cl,
cl_file_path=cl_file_path,
send_mail=(bool(params.get('--send_mail', False))))
+ elif verb == 'fail-if-private':
+ # internal use for pre-submit check
+ do_fail_if_private(given_cl=given_cl, current_cl=current_cl)
+
else:
show_help_and_exit()
--
---
You received this message because you are subscribed to the Google Groups "Google Caja Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.