Change the default of --promote from check to copy

As said in the PR. I forgot to push the commit.
This commit is contained in:
Jeremie Dimino 2018-01-15 14:55:17 +00:00
parent ce901a4731
commit d4dec9b4f5
4 changed files with 17 additions and 15 deletions

View File

@ -291,10 +291,11 @@ let common =
Arg.(value Arg.(value
& opt (some mode) None & opt (some mode) None
& info ["promote"] ~docs & info ["promote"] ~docs
~doc:"How to interpret promote actions. $(b,check), the default, means to ~doc:"How to interpret promote actions. $(b,copy) means to print
only check that promoted files are equal to the source files. a diff and copy the generated files to the source tree when
$(b,ignore) means to ignore promote action altogether and $(b,copy) they differ. $(b,copy) is the default. $(b,check) means to
means to copy generated files to the source tree.") only print a diff without copying files. $(b,ignore) means
to ignore promote action altogether.")
in in
let for_release = "for-release-of-packages" in let for_release = "for-release-of-packages" in
let frop = let frop =
@ -327,7 +328,7 @@ let common =
| None, _, _, _ -> | None, _, _, _ ->
`Ok (root, `Ok (root,
only_packages, only_packages,
Option.value promote ~default:Clflags.Promote_mode.Check, Option.value promote ~default:Clflags.Promote_mode.Copy,
List.concat List.concat
[ dump_opt "--root" root [ dump_opt "--root" root
; dump_opt "--only-packages" only_packages ; dump_opt "--only-packages" only_packages

View File

@ -563,7 +563,7 @@ With this jbuild file, running jbuilder as follow will replace the
.. code:: shell .. code:: shell
$ jbuilder build @jbuild --promote copy $ jbuilder build @jbuild
Common items Common items
============ ============
@ -1158,12 +1158,13 @@ How jbuilder interprets promotions can be controlled using the
``--promote`` command line argument. The following behaviors are ``--promote`` command line argument. The following behaviors are
available: available:
- ``--promote check``: this is the default. Jbuilder just checks that - ``--promote copy``: when the two files given in a ``(<a> as <b>)``
the two files given in each ``(<a> as <b>)`` form are equal. If not, form are different, jbuilder prints a diff and copies ``<a>`` to
it prints a diff ``<b>`` directly in the source
tree. This is the default
- ``--promote check``: Jbuilder just checks that the two files are
equal and print a diff when there are not
- ``--promote ignore``: ``promote`` actions are simply ignored - ``--promote ignore``: ``promote`` actions are simply ignored
- ``--promote copy``: when the two files are different, jbuilder
prints a diff and copies ``<a>`` to ``<b>`` directly in the source tree
Note that ``-p/--for-release-of-packages`` implies ``--promote Note that ``-p/--for-release-of-packages`` implies ``--promote
ignore``. ignore``.

View File

@ -28,4 +28,4 @@ module Promote_mode = struct
| "copy" -> Some Copy | "copy" -> Some Copy
| _ -> None | _ -> None
end end
let promote_mode = ref Promote_mode.Check let promote_mode = ref Promote_mode.Copy

View File

@ -1,6 +1,6 @@
$ echo titi > x $ echo titi > x
$ $JBUILDER build --root . -j1 --diff-command false @blah $ $JBUILDER build --root . -j1 --diff-command false @blah --promote check
sh (internal) (exit 1) sh (internal) (exit 1)
/usr/bin/sh -c 'false '\''x'\'' '\''_build/default/x.gen'\''' /usr/bin/sh -c 'false '\''x'\'' '\''_build/default/x.gen'\'''
[1] [1]
@ -11,11 +11,11 @@
$ cat x $ cat x
titi titi
$ $JBUILDER build --root . -j1 --diff-command false @blah --promote copy $ $JBUILDER build --root . -j1 --diff-command false @blah
sh (internal) (exit 1) sh (internal) (exit 1)
/usr/bin/sh -c 'false '\''x'\'' '\''_build/default/x.gen'\''' /usr/bin/sh -c 'false '\''x'\'' '\''_build/default/x.gen'\'''
Promoting _build/default/x.gen to x. Promoting _build/default/x.gen to x.
[1] [1]
$ cat x $ cat x
toto toto
$ $JBUILDER build --root . -j1 --diff-command false @blah --promote copy $ $JBUILDER build --root . -j1 --diff-command false @blah