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:
parent
ce901a4731
commit
d4dec9b4f5
11
bin/main.ml
11
bin/main.ml
|
@ -291,10 +291,11 @@ let common =
|
|||
Arg.(value
|
||||
& opt (some mode) None
|
||||
& info ["promote"] ~docs
|
||||
~doc:"How to interpret promote actions. $(b,check), the default, means to
|
||||
only check that promoted files are equal to the source files.
|
||||
$(b,ignore) means to ignore promote action altogether and $(b,copy)
|
||||
means to copy generated files to the source tree.")
|
||||
~doc:"How to interpret promote actions. $(b,copy) means to print
|
||||
a diff and copy the generated files to the source tree when
|
||||
they differ. $(b,copy) is the default. $(b,check) means to
|
||||
only print a diff without copying files. $(b,ignore) means
|
||||
to ignore promote action altogether.")
|
||||
in
|
||||
let for_release = "for-release-of-packages" in
|
||||
let frop =
|
||||
|
@ -327,7 +328,7 @@ let common =
|
|||
| None, _, _, _ ->
|
||||
`Ok (root,
|
||||
only_packages,
|
||||
Option.value promote ~default:Clflags.Promote_mode.Check,
|
||||
Option.value promote ~default:Clflags.Promote_mode.Copy,
|
||||
List.concat
|
||||
[ dump_opt "--root" root
|
||||
; dump_opt "--only-packages" only_packages
|
||||
|
|
|
@ -563,7 +563,7 @@ With this jbuild file, running jbuilder as follow will replace the
|
|||
|
||||
.. code:: shell
|
||||
|
||||
$ jbuilder build @jbuild --promote copy
|
||||
$ jbuilder build @jbuild
|
||||
|
||||
Common items
|
||||
============
|
||||
|
@ -1158,12 +1158,13 @@ How jbuilder interprets promotions can be controlled using the
|
|||
``--promote`` command line argument. The following behaviors are
|
||||
available:
|
||||
|
||||
- ``--promote check``: this is the default. Jbuilder just checks that
|
||||
the two files given in each ``(<a> as <b>)`` form are equal. If not,
|
||||
it prints a diff
|
||||
- ``--promote copy``: when the two files given in a ``(<a> as <b>)``
|
||||
form are different, jbuilder prints a diff and copies ``<a>`` to
|
||||
``<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 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
|
||||
ignore``.
|
||||
|
|
|
@ -28,4 +28,4 @@ module Promote_mode = struct
|
|||
| "copy" -> Some Copy
|
||||
| _ -> None
|
||||
end
|
||||
let promote_mode = ref Promote_mode.Check
|
||||
let promote_mode = ref Promote_mode.Copy
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
$ 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)
|
||||
/usr/bin/sh -c 'false '\''x'\'' '\''_build/default/x.gen'\'''
|
||||
[1]
|
||||
|
@ -11,11 +11,11 @@
|
|||
$ cat x
|
||||
titi
|
||||
|
||||
$ $JBUILDER build --root . -j1 --diff-command false @blah --promote copy
|
||||
$ $JBUILDER build --root . -j1 --diff-command false @blah
|
||||
sh (internal) (exit 1)
|
||||
/usr/bin/sh -c 'false '\''x'\'' '\''_build/default/x.gen'\'''
|
||||
Promoting _build/default/x.gen to x.
|
||||
[1]
|
||||
$ cat x
|
||||
toto
|
||||
$ $JBUILDER build --root . -j1 --diff-command false @blah --promote copy
|
||||
$ $JBUILDER build --root . -j1 --diff-command false @blah
|
||||
|
|
Loading…
Reference in New Issue