48 templater, |
48 templater, |
49 util, |
49 util, |
50 vfs as vfsmod, |
50 vfs as vfsmod, |
51 ) |
51 ) |
52 stringio = util.stringio |
52 stringio = util.stringio |
|
53 |
|
54 # templates of common command options |
|
55 |
|
56 dryrunopts = [ |
|
57 ('n', 'dry-run', None, |
|
58 _('do not perform actions, just print output')), |
|
59 ] |
|
60 |
|
61 remoteopts = [ |
|
62 ('e', 'ssh', '', |
|
63 _('specify ssh command to use'), _('CMD')), |
|
64 ('', 'remotecmd', '', |
|
65 _('specify hg command to run on the remote side'), _('CMD')), |
|
66 ('', 'insecure', None, |
|
67 _('do not verify server certificate (ignoring web.cacerts config)')), |
|
68 ] |
|
69 |
|
70 walkopts = [ |
|
71 ('I', 'include', [], |
|
72 _('include names matching the given patterns'), _('PATTERN')), |
|
73 ('X', 'exclude', [], |
|
74 _('exclude names matching the given patterns'), _('PATTERN')), |
|
75 ] |
|
76 |
|
77 commitopts = [ |
|
78 ('m', 'message', '', |
|
79 _('use text as commit message'), _('TEXT')), |
|
80 ('l', 'logfile', '', |
|
81 _('read commit message from file'), _('FILE')), |
|
82 ] |
|
83 |
|
84 commitopts2 = [ |
|
85 ('d', 'date', '', |
|
86 _('record the specified date as commit date'), _('DATE')), |
|
87 ('u', 'user', '', |
|
88 _('record the specified user as committer'), _('USER')), |
|
89 ] |
|
90 |
|
91 # hidden for now |
|
92 formatteropts = [ |
|
93 ('T', 'template', '', |
|
94 _('display with template (EXPERIMENTAL)'), _('TEMPLATE')), |
|
95 ] |
|
96 |
|
97 templateopts = [ |
|
98 ('', 'style', '', |
|
99 _('display using template map file (DEPRECATED)'), _('STYLE')), |
|
100 ('T', 'template', '', |
|
101 _('display with template'), _('TEMPLATE')), |
|
102 ] |
|
103 |
|
104 logopts = [ |
|
105 ('p', 'patch', None, _('show patch')), |
|
106 ('g', 'git', None, _('use git extended diff format')), |
|
107 ('l', 'limit', '', |
|
108 _('limit number of changes displayed'), _('NUM')), |
|
109 ('M', 'no-merges', None, _('do not show merges')), |
|
110 ('', 'stat', None, _('output diffstat-style summary of changes')), |
|
111 ('G', 'graph', None, _("show the revision DAG")), |
|
112 ] + templateopts |
|
113 |
|
114 diffopts = [ |
|
115 ('a', 'text', None, _('treat all files as text')), |
|
116 ('g', 'git', None, _('use git extended diff format')), |
|
117 ('', 'binary', None, _('generate binary diffs in git mode (default)')), |
|
118 ('', 'nodates', None, _('omit dates from diff headers')) |
|
119 ] |
|
120 |
|
121 diffwsopts = [ |
|
122 ('w', 'ignore-all-space', None, |
|
123 _('ignore white space when comparing lines')), |
|
124 ('b', 'ignore-space-change', None, |
|
125 _('ignore changes in the amount of white space')), |
|
126 ('B', 'ignore-blank-lines', None, |
|
127 _('ignore changes whose lines are all blank')), |
|
128 ] |
|
129 |
|
130 diffopts2 = [ |
|
131 ('', 'noprefix', None, _('omit a/ and b/ prefixes from filenames')), |
|
132 ('p', 'show-function', None, _('show which function each change is in')), |
|
133 ('', 'reverse', None, _('produce a diff that undoes the changes')), |
|
134 ] + diffwsopts + [ |
|
135 ('U', 'unified', '', |
|
136 _('number of lines of context to show'), _('NUM')), |
|
137 ('', 'stat', None, _('output diffstat-style summary of changes')), |
|
138 ('', 'root', '', _('produce diffs relative to subdirectory'), _('DIR')), |
|
139 ] |
|
140 |
|
141 mergetoolopts = [ |
|
142 ('t', 'tool', '', _('specify merge tool')), |
|
143 ] |
|
144 |
|
145 similarityopts = [ |
|
146 ('s', 'similarity', '', |
|
147 _('guess renamed files by similarity (0<=s<=100)'), _('SIMILARITY')) |
|
148 ] |
|
149 |
|
150 subrepoopts = [ |
|
151 ('S', 'subrepos', None, |
|
152 _('recurse into subrepositories')) |
|
153 ] |
|
154 |
|
155 debugrevlogopts = [ |
|
156 ('c', 'changelog', False, _('open changelog')), |
|
157 ('m', 'manifest', False, _('open manifest')), |
|
158 ('', 'dir', '', _('open directory manifest')), |
|
159 ] |
53 |
160 |
54 # special string such that everything below this line will be ingored in the |
161 # special string such that everything below this line will be ingored in the |
55 # editor text |
162 # editor text |
56 _linebelow = "^HG: ------------------------ >8 ------------------------$" |
163 _linebelow = "^HG: ------------------------ >8 ------------------------$" |
57 |
164 |