##// END OF EJS Templates
help: cleanup grammar in the hooks section
Matt Harbison -
r33250:26c49ed5 4.2.2 stable
parent child Browse files
Show More
@@ -861,31 +861,31 b' Example ``.hg/hgrc``::'
861 861
862 862 Most hooks are run with environment variables set that give useful
863 863 additional information. For each hook below, the environment variables
864 it is passed are listed with names of the form ``$HG_foo``. The
864 it is passed are listed with names in the form ``$HG_foo``. The
865 865 ``$HG_HOOKTYPE`` and ``$HG_HOOKNAME`` variables are set for all hooks.
866 their respectively contains the type of hook which triggered the run and
867 the full name of the hooks in the config. In the example about this will
866 They contain the type of hook which triggered the run and the full name
867 of the hook in the config, respectively. In the example above, this will
868 868 be ``$HG_HOOKTYPE=incoming`` and ``$HG_HOOKNAME=incoming.email``.
869 869
870 870 ``changegroup``
871 Run after a changegroup has been added via push, pull or unbundle. ID of the
872 first new changeset is in ``$HG_NODE`` and last in ``$HG_NODE_LAST``. URL
873 from which changes came is in ``$HG_URL``.
871 Run after a changegroup has been added via push, pull or unbundle. The ID of
872 the first new changeset is in ``$HG_NODE`` and last is in ``$HG_NODE_LAST``.
873 The URL from which changes came is in ``$HG_URL``.
874 874
875 875 ``commit``
876 Run after a changeset has been created in the local repository. ID
876 Run after a changeset has been created in the local repository. The ID
877 877 of the newly created changeset is in ``$HG_NODE``. Parent changeset
878 878 IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
879 879
880 880 ``incoming``
881 881 Run after a changeset has been pulled, pushed, or unbundled into
882 882 the local repository. The ID of the newly arrived changeset is in
883 ``$HG_NODE``. URL that was source of changes came is in ``$HG_URL``.
883 ``$HG_NODE``. The URL that was source of the changes is in ``$HG_URL``.
884 884
885 885 ``outgoing``
886 Run after sending changes from local repository to another. ID of
887 first changeset sent is in ``$HG_NODE``. Source of operation is in
888 ``$HG_SOURCE``; Also see :hg:`help config.hooks.preoutgoing` hook.
886 Run after sending changes from the local repository to another. The ID of
887 first changeset sent is in ``$HG_NODE``. The source of operation is in
888 ``$HG_SOURCE``. Also see :hg:`help config.hooks.preoutgoing`.
889 889
890 890 ``post-<command>``
891 891 Run after successful invocations of the associated command. The
@@ -917,93 +917,94 b' be ``$HG_HOOKTYPE=incoming`` and ``$HG_H'
917 917
918 918 ``prechangegroup``
919 919 Run before a changegroup is added via push, pull or unbundle. Exit
920 status 0 allows the changegroup to proceed. Non-zero status will
921 cause the push, pull or unbundle to fail. URL from which changes
920 status 0 allows the changegroup to proceed. A non-zero status will
921 cause the push, pull or unbundle to fail. The URL from which changes
922 922 will come is in ``$HG_URL``.
923 923
924 924 ``precommit``
925 925 Run before starting a local commit. Exit status 0 allows the
926 commit to proceed. Non-zero status will cause the commit to fail.
926 commit to proceed. A non-zero status will cause the commit to fail.
927 927 Parent changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
928 928
929 929 ``prelistkeys``
930 930 Run before listing pushkeys (like bookmarks) in the
931 repository. Non-zero status will cause failure. The key namespace is
931 repository. A non-zero status will cause failure. The key namespace is
932 932 in ``$HG_NAMESPACE``.
933 933
934 934 ``preoutgoing``
935 935 Run before collecting changes to send from the local repository to
936 another. Non-zero status will cause failure. This lets you prevent
937 pull over HTTP or SSH. Also prevents against local pull, push
938 (outbound) or bundle commands, but not effective, since you can
939 just copy files instead then. Source of operation is in
940 ``$HG_SOURCE``. If "serve", operation is happening on behalf of remote
941 SSH or HTTP repository. If "push", "pull" or "bundle", operation
942 is happening on behalf of repository on same system.
936 another. A non-zero status will cause failure. This lets you prevent
937 pull over HTTP or SSH. It can also prevent propagating commits (via
938 local pull, push (outbound) or bundle commands), but not completely,
939 since you can just copy files instead. The source of operation is in
940 ``$HG_SOURCE``. If "serve", the operation is happening on behalf of a remote
941 SSH or HTTP repository. If "push", "pull" or "bundle", the operation
942 is happening on behalf of a repository on same system.
943 943
944 944 ``prepushkey``
945 945 Run before a pushkey (like a bookmark) is added to the
946 repository. Non-zero status will cause the key to be rejected. The
946 repository. A non-zero status will cause the key to be rejected. The
947 947 key namespace is in ``$HG_NAMESPACE``, the key is in ``$HG_KEY``,
948 948 the old value (if any) is in ``$HG_OLD``, and the new value is in
949 949 ``$HG_NEW``.
950 950
951 951 ``pretag``
952 952 Run before creating a tag. Exit status 0 allows the tag to be
953 created. Non-zero status will cause the tag to fail. ID of
954 changeset to tag is in ``$HG_NODE``. Name of tag is in ``$HG_TAG``. Tag is
955 local if ``$HG_LOCAL=1``, in repository if ``$HG_LOCAL=0``.
953 created. A non-zero status will cause the tag to fail. The ID of the
954 changeset to tag is in ``$HG_NODE``. The name of tag is in ``$HG_TAG``. The
955 tag is local if ``$HG_LOCAL=1``, or in the repository if ``$HG_LOCAL=0``.
956 956
957 957 ``pretxnopen``
958 958 Run before any new repository transaction is open. The reason for the
959 transaction will be in ``$HG_TXNNAME`` and a unique identifier for the
959 transaction will be in ``$HG_TXNNAME``, and a unique identifier for the
960 960 transaction will be in ``HG_TXNID``. A non-zero status will prevent the
961 961 transaction from being opened.
962 962
963 963 ``pretxnclose``
964 964 Run right before the transaction is actually finalized. Any repository change
965 965 will be visible to the hook program. This lets you validate the transaction
966 content or change it. Exit status 0 allows the commit to proceed. Non-zero
966 content or change it. Exit status 0 allows the commit to proceed. A non-zero
967 967 status will cause the transaction to be rolled back. The reason for the
968 transaction opening will be in ``$HG_TXNNAME`` and a unique identifier for
968 transaction opening will be in ``$HG_TXNNAME``, and a unique identifier for
969 969 the transaction will be in ``HG_TXNID``. The rest of the available data will
970 vary according the transaction type. New changesets will add ``$HG_NODE`` (id
971 of the first added changeset), ``$HG_NODE_LAST`` (id of the last added
972 changeset), ``$HG_URL`` and ``$HG_SOURCE`` variables, bookmarks and phases
973 changes will set ``HG_BOOKMARK_MOVED`` and ``HG_PHASES_MOVED`` to ``1``, etc.
970 vary according the transaction type. New changesets will add ``$HG_NODE``
971 (the ID of the first added changeset), ``$HG_NODE_LAST`` (the ID of the last
972 added changeset), ``$HG_URL`` and ``$HG_SOURCE`` variables. Bookmark and
973 phase changes will set ``HG_BOOKMARK_MOVED`` and ``HG_PHASES_MOVED`` to ``1``
974 respectively, etc.
974 975
975 976 ``txnclose``
976 977 Run after any repository transaction has been committed. At this
977 978 point, the transaction can no longer be rolled back. The hook will run
978 after the lock is released. See :hg:`help config.hooks.pretxnclose` docs for
979 after the lock is released. See :hg:`help config.hooks.pretxnclose` for
979 980 details about available variables.
980 981
981 982 ``txnabort``
982 983 Run when a transaction is aborted. See :hg:`help config.hooks.pretxnclose`
983 docs for details about available variables.
984 for details about available variables.
984 985
985 986 ``pretxnchangegroup``
986 987 Run after a changegroup has been added via push, pull or unbundle, but before
987 the transaction has been committed. Changegroup is visible to hook program.
988 This lets you validate incoming changes before accepting them. Passed the ID
989 of the first new changeset in ``$HG_NODE`` and last in ``$HG_NODE_LAST``.
990 Exit status 0 allows the transaction to commit. Non-zero status will cause
991 the transaction to be rolled back and the push, pull or unbundle will fail.
992 URL that was source of changes is in ``$HG_URL``.
988 the transaction has been committed. The changegroup is visible to the hook
989 program. This allows validation of incoming changes before accepting them.
990 The ID of the first new changeset is in ``$HG_NODE`` and last is in
991 ``$HG_NODE_LAST``. Exit status 0 allows the transaction to commit. A non-zero
992 status will cause the transaction to be rolled back, and the push, pull or
993 unbundle will fail. The URL that was the source of changes is in ``$HG_URL``.
993 994
994 995 ``pretxncommit``
995 Run after a changeset has been created but the transaction not yet
996 committed. Changeset is visible to hook program. This lets you
997 validate commit message and changes. Exit status 0 allows the
998 commit to proceed. Non-zero status will cause the transaction to
999 be rolled back. ID of changeset is in ``$HG_NODE``. Parent changeset
1000 IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
996 Run after a changeset has been created, but before the transaction is
997 committed. The changeset is visible to the hook program. This allows
998 validation of the commit message and changes. Exit status 0 allows the
999 commit to proceed. A non-zero status will cause the transaction to
1000 be rolled back. The ID of the new changeset is in ``$HG_NODE``. The parent
1001 changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
1001 1002
1002 1003 ``preupdate``
1003 1004 Run before updating the working directory. Exit status 0 allows
1004 the update to proceed. Non-zero status will prevent the update.
1005 Changeset ID of first new parent is in ``$HG_PARENT1``. If merge, ID
1006 of second new parent is in ``$HG_PARENT2``.
1005 the update to proceed. A non-zero status will prevent the update.
1006 The changeset ID of first new parent is in ``$HG_PARENT1``. If updating to a
1007 merge, the ID of second new parent is in ``$HG_PARENT2``.
1007 1008
1008 1009 ``listkeys``
1009 1010 Run after listing pushkeys (like bookmarks) in the repository. The
@@ -1017,20 +1018,20 b' be ``$HG_HOOKTYPE=incoming`` and ``$HG_H'
1017 1018 value is in ``$HG_NEW``.
1018 1019
1019 1020 ``tag``
1020 Run after a tag is created. ID of tagged changeset is in ``$HG_NODE``.
1021 Name of tag is in ``$HG_TAG``. Tag is local if ``$HG_LOCAL=1``, in
1022 repository if ``$HG_LOCAL=0``.
1021 Run after a tag is created. The ID of the tagged changeset is in ``$HG_NODE``.
1022 The name of tag is in ``$HG_TAG``. The tag is local if ``$HG_LOCAL=1``, or in
1023 the repository if ``$HG_LOCAL=0``.
1023 1024
1024 1025 ``update``
1025 Run after updating the working directory. Changeset ID of first
1026 new parent is in ``$HG_PARENT1``. If merge, ID of second new parent is
1027 in ``$HG_PARENT2``. If the update succeeded, ``$HG_ERROR=0``. If the
1028 update failed (e.g. because conflicts not resolved), ``$HG_ERROR=1``.
1026 Run after updating the working directory. The changeset ID of first
1027 new parent is in ``$HG_PARENT1``. If updating to a merge, the ID of second new
1028 parent is in ``$HG_PARENT2``. If the update succeeded, ``$HG_ERROR=0``. If the
1029 update failed (e.g. because conflicts were not resolved), ``$HG_ERROR=1``.
1029 1030
1030 1031 .. note::
1031 1032
1032 1033 It is generally better to use standard hooks rather than the
1033 generic pre- and post- command hooks as they are guaranteed to be
1034 generic pre- and post- command hooks, as they are guaranteed to be
1034 1035 called in the appropriate contexts for influencing transactions.
1035 1036 Also, hooks like "commit" will be called in all contexts that
1036 1037 generate a commit (e.g. tag) and not just the commit command.
General Comments 0
You need to be logged in to leave comments. Login now