View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.maven.scm.provider.hg.command;
20  
21  /**
22   * Available/Used hg commands.
23   * <p>
24   * These commands do not necessarily correspond to the SCM API.
25   * Eg. "check in" is translated to be "commit" and "push".
26   *
27   * @author <a href="mailto:thurner.rupert@ymono.net">thurner rupert</a>
28   */
29  public final class HgCommandConstants {
30  
31      private HgCommandConstants() {
32          // no o
33      }
34  
35      /**
36       * Executable for Hg
37       */
38      public static final String EXEC = "hg";
39  
40      /**
41       * Use to create an empty branch or before importing an existing project
42       */
43      public static final String INIT_CMD = "init";
44  
45      /**
46       * Default recursive. Common option: --dry-run and --no-recursive
47       */
48      public static final String ADD_CMD = "add";
49  
50      /**
51       * Reports the following states: added, removed, modified, unchanged, unknown
52       */
53      public static final String STATUS_CMD = "status";
54  
55      /**
56       * Make a file unversioned
57       */
58      public static final String REMOVE_CMD = "remove";
59  
60      /**
61       * Create a new copy of a branch. Alias get or clone
62       */
63      public static final String CLONE_CMD = "clone";
64  
65      /**
66       * Create a new branch in the repo.
67       */
68      public static final String BRANCH_CMD = "branch";
69  
70      /**
71       * Commit changes into a new revision
72       */
73      public static final String COMMIT_CMD = "commit";
74  
75      /**
76       * update working-copy to tip
77       */
78      public static final String UPDATE_CMD = "update";
79  
80      /**
81       * Pull any changes from another branch into the current one
82       */
83      public static final String PULL_CMD = "pull";
84  
85      /**
86       * Show log of this branch Common option: --revision
87       */
88      public static final String LOG_CMD = "log";
89  
90      /**
91       * Show differences in workingtree. Common option: --revision
92       */
93      public static final String DIFF_CMD = "diff";
94  
95      /**
96       * Push this branch into another branch
97       */
98      public static final String PUSH_CMD = "push";
99  
100     /**
101      * Show current revision number
102      */
103     public static final String REVNO_CMD = "id";
104 
105     /**
106      * Tag this revision
107      */
108     public static final String TAG_CMD = "tag";
109 
110     /**
111      * Show list of the current working copy or a revision
112      */
113     public static final String INVENTORY_CMD = "locate";
114 
115     /**
116      * Outgoing changes command
117      */
118     public static final String OUTGOING_CMD = "outgoing";
119 
120     /**
121      * Named branch command
122      */
123     public static final String BRANCH_NAME_CMD = "branch";
124 
125     /**
126      * no recurse option does not exist in mercurial
127      */
128     public static final String NO_RECURSE_OPTION = "";
129 
130     public static final String MESSAGE_OPTION = "--message";
131 
132     public static final String REVISION_OPTION = "-r";
133 
134     public static final String DATE_OPTION = "--date";
135 
136     public static final String VERBOSE_OPTION = "--verbose";
137 
138     public static final String NO_MERGES_OPTION = "--no-merges";
139 
140     public static final String VERSION = "version";
141 
142     public static final String CHECK = "check";
143 
144     public static final String ALL_OPTION = "-A";
145 
146     public static final String NEW_BRANCH_OPTION = "--new-branch";
147 
148     public static final String CLEAN_OPTION = "-c";
149 
150     public static final String TEMPLATE_OPTION = "--template";
151 
152     /**
153      * limit number of changes displayed
154      */
155     public static final String LIMIT_OPTION = "--limit";
156 
157     /**
158      * A template for the log output in order to decouple the date parsing from
159      * system and java locale, also helps avoiding bug due changes on the
160      * verbose format for log command.
161      */
162     public static final String TEMPLATE_FORMAT =
163             "changeset:   {rev}:{node|short}\\nbranch:      {branch}\\nuser:        {author}\\n"
164                     + "date:        {date|isodatesec}\\ntag:         {tags}\\nfiles:       {files}\\ndescription:\\n{desc}\\n";
165 }