Show More
@@ -1,104 +1,116 b'' | |||||
1 | # help.py - help data for mercurial |
|
1 | # help.py - help data for mercurial | |
2 | # |
|
2 | # | |
3 | # Copyright 2006 Matt Mackall <mpm@selenic.com> |
|
3 | # Copyright 2006 Matt Mackall <mpm@selenic.com> | |
4 | # |
|
4 | # | |
5 | # This software may be used and distributed according to the terms of the |
|
5 | # This software may be used and distributed according to the terms of the | |
6 | # GNU General Public License version 2 or any later version. |
|
6 | # GNU General Public License version 2 or any later version. | |
7 |
|
7 | |||
8 | from i18n import gettext, _ |
|
8 | from i18n import gettext, _ | |
9 | import sys, os |
|
9 | import sys, os | |
10 | import extensions |
|
10 | import extensions | |
11 |
|
11 | |||
12 |
|
12 | |||
13 | def moduledoc(file): |
|
13 | def moduledoc(file): | |
14 | '''return the top-level python documentation for the given file |
|
14 | '''return the top-level python documentation for the given file | |
15 |
|
15 | |||
16 | Loosely inspired by pydoc.source_synopsis(), but rewritten to |
|
16 | Loosely inspired by pydoc.source_synopsis(), but rewritten to | |
17 | handle triple quotes and to return the whole text instead of just |
|
17 | handle triple quotes and to return the whole text instead of just | |
18 | the synopsis''' |
|
18 | the synopsis''' | |
19 | result = [] |
|
19 | result = [] | |
20 |
|
20 | |||
21 | line = file.readline() |
|
21 | line = file.readline() | |
22 | while line[:1] == '#' or not line.strip(): |
|
22 | while line[:1] == '#' or not line.strip(): | |
23 | line = file.readline() |
|
23 | line = file.readline() | |
24 | if not line: |
|
24 | if not line: | |
25 | break |
|
25 | break | |
26 |
|
26 | |||
27 | start = line[:3] |
|
27 | start = line[:3] | |
28 | if start == '"""' or start == "'''": |
|
28 | if start == '"""' or start == "'''": | |
29 | line = line[3:] |
|
29 | line = line[3:] | |
30 | while line: |
|
30 | while line: | |
31 | if line.rstrip().endswith(start): |
|
31 | if line.rstrip().endswith(start): | |
32 | line = line.split(start)[0] |
|
32 | line = line.split(start)[0] | |
33 | if line: |
|
33 | if line: | |
34 | result.append(line) |
|
34 | result.append(line) | |
35 | break |
|
35 | break | |
36 | elif not line: |
|
36 | elif not line: | |
37 | return None # unmatched delimiter |
|
37 | return None # unmatched delimiter | |
38 | result.append(line) |
|
38 | result.append(line) | |
39 | line = file.readline() |
|
39 | line = file.readline() | |
40 | else: |
|
40 | else: | |
41 | return None |
|
41 | return None | |
42 |
|
42 | |||
43 | return ''.join(result) |
|
43 | return ''.join(result) | |
44 |
|
44 | |||
45 | def listexts(header, exts, maxlength, indent=1): |
|
45 | def listexts(header, exts, maxlength, indent=1): | |
46 | '''return a text listing of the given extensions''' |
|
46 | '''return a text listing of the given extensions''' | |
47 | if not exts: |
|
47 | if not exts: | |
48 | return '' |
|
48 | return '' | |
49 | result = '\n%s\n\n' % header |
|
49 | result = '\n%s\n\n' % header | |
50 | for name, desc in sorted(exts.iteritems()): |
|
50 | for name, desc in sorted(exts.iteritems()): | |
51 | result += '%s%-*s %s\n' % (' ' * indent, maxlength + 2, |
|
51 | result += '%s%-*s %s\n' % (' ' * indent, maxlength + 2, | |
52 | ':%s:' % name, desc) |
|
52 | ':%s:' % name, desc) | |
53 | return result |
|
53 | return result | |
54 |
|
54 | |||
55 | def extshelp(): |
|
55 | def extshelp(): | |
56 | doc = loaddoc('extensions')() |
|
56 | doc = loaddoc('extensions')() | |
57 |
|
57 | |||
58 | exts, maxlength = extensions.enabled() |
|
58 | exts, maxlength = extensions.enabled() | |
59 | doc += listexts(_('enabled extensions:'), exts, maxlength) |
|
59 | doc += listexts(_('enabled extensions:'), exts, maxlength) | |
60 |
|
60 | |||
61 | exts, maxlength = extensions.disabled() |
|
61 | exts, maxlength = extensions.disabled() | |
62 | doc += listexts(_('disabled extensions:'), exts, maxlength) |
|
62 | doc += listexts(_('disabled extensions:'), exts, maxlength) | |
63 |
|
63 | |||
64 | return doc |
|
64 | return doc | |
65 |
|
65 | |||
66 | def loaddoc(topic): |
|
66 | def loaddoc(topic): | |
67 | """Return a delayed loader for help/topic.txt.""" |
|
67 | """Return a delayed loader for help/topic.txt.""" | |
68 |
|
68 | |||
69 | def loader(): |
|
69 | def loader(): | |
70 | if hasattr(sys, 'frozen'): |
|
70 | if hasattr(sys, 'frozen'): | |
71 | module = sys.executable |
|
71 | module = sys.executable | |
72 | else: |
|
72 | else: | |
73 | module = __file__ |
|
73 | module = __file__ | |
74 | base = os.path.dirname(module) |
|
74 | base = os.path.dirname(module) | |
75 |
|
75 | |||
76 | for dir in ('.', '..'): |
|
76 | for dir in ('.', '..'): | |
77 | docdir = os.path.join(base, dir, 'help') |
|
77 | docdir = os.path.join(base, dir, 'help') | |
78 | if os.path.isdir(docdir): |
|
78 | if os.path.isdir(docdir): | |
79 | break |
|
79 | break | |
80 |
|
80 | |||
81 | path = os.path.join(docdir, topic + ".txt") |
|
81 | path = os.path.join(docdir, topic + ".txt") | |
82 |
|
|
82 | doc = gettext(open(path).read()) | |
|
83 | for rewriter in helphooks.get(topic, []): | |||
|
84 | doc = rewriter(topic, doc) | |||
|
85 | return doc | |||
|
86 | ||||
83 | return loader |
|
87 | return loader | |
84 |
|
88 | |||
85 | helptable = [ |
|
89 | helptable = [ | |
86 | (["config", "hgrc"], _("Configuration Files"), loaddoc('config')), |
|
90 | (["config", "hgrc"], _("Configuration Files"), loaddoc('config')), | |
87 | (["dates"], _("Date Formats"), loaddoc('dates')), |
|
91 | (["dates"], _("Date Formats"), loaddoc('dates')), | |
88 | (["patterns"], _("File Name Patterns"), loaddoc('patterns')), |
|
92 | (["patterns"], _("File Name Patterns"), loaddoc('patterns')), | |
89 | (['environment', 'env'], _('Environment Variables'), |
|
93 | (['environment', 'env'], _('Environment Variables'), | |
90 | loaddoc('environment')), |
|
94 | loaddoc('environment')), | |
91 | (['revs', 'revisions'], _('Specifying Single Revisions'), |
|
95 | (['revs', 'revisions'], _('Specifying Single Revisions'), | |
92 | loaddoc('revisions')), |
|
96 | loaddoc('revisions')), | |
93 | (['mrevs', 'multirevs'], _('Specifying Multiple Revisions'), |
|
97 | (['mrevs', 'multirevs'], _('Specifying Multiple Revisions'), | |
94 | loaddoc('multirevs')), |
|
98 | loaddoc('multirevs')), | |
95 | (['revset', 'revsets'], _("Specifying Revision Sets"), loaddoc('revsets')), |
|
99 | (['revset', 'revsets'], _("Specifying Revision Sets"), loaddoc('revsets')), | |
96 | (['diffs'], _('Diff Formats'), loaddoc('diffs')), |
|
100 | (['diffs'], _('Diff Formats'), loaddoc('diffs')), | |
97 | (['merge-tools'], _('Merge Tools'), loaddoc('merge-tools')), |
|
101 | (['merge-tools'], _('Merge Tools'), loaddoc('merge-tools')), | |
98 | (['templating', 'templates'], _('Template Usage'), |
|
102 | (['templating', 'templates'], _('Template Usage'), | |
99 | loaddoc('templates')), |
|
103 | loaddoc('templates')), | |
100 | (['urls'], _('URL Paths'), loaddoc('urls')), |
|
104 | (['urls'], _('URL Paths'), loaddoc('urls')), | |
101 | (["extensions"], _("Using additional features"), extshelp), |
|
105 | (["extensions"], _("Using additional features"), extshelp), | |
102 | (["hgweb"], _("Configuring hgweb"), loaddoc('hgweb')), |
|
106 | (["hgweb"], _("Configuring hgweb"), loaddoc('hgweb')), | |
103 | (["glossary"], _("Glossary"), loaddoc('glossary')), |
|
107 | (["glossary"], _("Glossary"), loaddoc('glossary')), | |
104 | ] |
|
108 | ] | |
|
109 | ||||
|
110 | # Map topics to lists of callable taking the current topic help and | |||
|
111 | # returning the updated version | |||
|
112 | helphooks = { | |||
|
113 | } | |||
|
114 | ||||
|
115 | def addtopichook(topic, rewriter): | |||
|
116 | helphooks.setdefault(topic, []).append(rewriter) |
@@ -1,758 +1,785 b'' | |||||
1 | Short help: |
|
1 | Short help: | |
2 |
|
2 | |||
3 | $ hg |
|
3 | $ hg | |
4 | Mercurial Distributed SCM |
|
4 | Mercurial Distributed SCM | |
5 |
|
5 | |||
6 | basic commands: |
|
6 | basic commands: | |
7 |
|
7 | |||
8 | add add the specified files on the next commit |
|
8 | add add the specified files on the next commit | |
9 | annotate show changeset information by line for each file |
|
9 | annotate show changeset information by line for each file | |
10 | clone make a copy of an existing repository |
|
10 | clone make a copy of an existing repository | |
11 | commit commit the specified files or all outstanding changes |
|
11 | commit commit the specified files or all outstanding changes | |
12 | diff diff repository (or selected files) |
|
12 | diff diff repository (or selected files) | |
13 | export dump the header and diffs for one or more changesets |
|
13 | export dump the header and diffs for one or more changesets | |
14 | forget forget the specified files on the next commit |
|
14 | forget forget the specified files on the next commit | |
15 | init create a new repository in the given directory |
|
15 | init create a new repository in the given directory | |
16 | log show revision history of entire repository or files |
|
16 | log show revision history of entire repository or files | |
17 | merge merge working directory with another revision |
|
17 | merge merge working directory with another revision | |
18 | pull pull changes from the specified source |
|
18 | pull pull changes from the specified source | |
19 | push push changes to the specified destination |
|
19 | push push changes to the specified destination | |
20 | remove remove the specified files on the next commit |
|
20 | remove remove the specified files on the next commit | |
21 | serve start stand-alone webserver |
|
21 | serve start stand-alone webserver | |
22 | status show changed files in the working directory |
|
22 | status show changed files in the working directory | |
23 | summary summarize working directory state |
|
23 | summary summarize working directory state | |
24 | update update working directory (or switch revisions) |
|
24 | update update working directory (or switch revisions) | |
25 |
|
25 | |||
26 | use "hg help" for the full list of commands or "hg -v" for details |
|
26 | use "hg help" for the full list of commands or "hg -v" for details | |
27 |
|
27 | |||
28 | $ hg -q |
|
28 | $ hg -q | |
29 | add add the specified files on the next commit |
|
29 | add add the specified files on the next commit | |
30 | annotate show changeset information by line for each file |
|
30 | annotate show changeset information by line for each file | |
31 | clone make a copy of an existing repository |
|
31 | clone make a copy of an existing repository | |
32 | commit commit the specified files or all outstanding changes |
|
32 | commit commit the specified files or all outstanding changes | |
33 | diff diff repository (or selected files) |
|
33 | diff diff repository (or selected files) | |
34 | export dump the header and diffs for one or more changesets |
|
34 | export dump the header and diffs for one or more changesets | |
35 | forget forget the specified files on the next commit |
|
35 | forget forget the specified files on the next commit | |
36 | init create a new repository in the given directory |
|
36 | init create a new repository in the given directory | |
37 | log show revision history of entire repository or files |
|
37 | log show revision history of entire repository or files | |
38 | merge merge working directory with another revision |
|
38 | merge merge working directory with another revision | |
39 | pull pull changes from the specified source |
|
39 | pull pull changes from the specified source | |
40 | push push changes to the specified destination |
|
40 | push push changes to the specified destination | |
41 | remove remove the specified files on the next commit |
|
41 | remove remove the specified files on the next commit | |
42 | serve start stand-alone webserver |
|
42 | serve start stand-alone webserver | |
43 | status show changed files in the working directory |
|
43 | status show changed files in the working directory | |
44 | summary summarize working directory state |
|
44 | summary summarize working directory state | |
45 | update update working directory (or switch revisions) |
|
45 | update update working directory (or switch revisions) | |
46 |
|
46 | |||
47 | $ hg help |
|
47 | $ hg help | |
48 | Mercurial Distributed SCM |
|
48 | Mercurial Distributed SCM | |
49 |
|
49 | |||
50 | list of commands: |
|
50 | list of commands: | |
51 |
|
51 | |||
52 | add add the specified files on the next commit |
|
52 | add add the specified files on the next commit | |
53 | addremove add all new files, delete all missing files |
|
53 | addremove add all new files, delete all missing files | |
54 | annotate show changeset information by line for each file |
|
54 | annotate show changeset information by line for each file | |
55 | archive create an unversioned archive of a repository revision |
|
55 | archive create an unversioned archive of a repository revision | |
56 | backout reverse effect of earlier changeset |
|
56 | backout reverse effect of earlier changeset | |
57 | bisect subdivision search of changesets |
|
57 | bisect subdivision search of changesets | |
58 | branch set or show the current branch name |
|
58 | branch set or show the current branch name | |
59 | branches list repository named branches |
|
59 | branches list repository named branches | |
60 | bundle create a changegroup file |
|
60 | bundle create a changegroup file | |
61 | cat output the current or given revision of files |
|
61 | cat output the current or given revision of files | |
62 | clone make a copy of an existing repository |
|
62 | clone make a copy of an existing repository | |
63 | commit commit the specified files or all outstanding changes |
|
63 | commit commit the specified files or all outstanding changes | |
64 | copy mark files as copied for the next commit |
|
64 | copy mark files as copied for the next commit | |
65 | diff diff repository (or selected files) |
|
65 | diff diff repository (or selected files) | |
66 | export dump the header and diffs for one or more changesets |
|
66 | export dump the header and diffs for one or more changesets | |
67 | forget forget the specified files on the next commit |
|
67 | forget forget the specified files on the next commit | |
68 | grep search for a pattern in specified files and revisions |
|
68 | grep search for a pattern in specified files and revisions | |
69 | heads show current repository heads or show branch heads |
|
69 | heads show current repository heads or show branch heads | |
70 | help show help for a given topic or a help overview |
|
70 | help show help for a given topic or a help overview | |
71 | identify identify the working copy or specified revision |
|
71 | identify identify the working copy or specified revision | |
72 | import import an ordered set of patches |
|
72 | import import an ordered set of patches | |
73 | incoming show new changesets found in source |
|
73 | incoming show new changesets found in source | |
74 | init create a new repository in the given directory |
|
74 | init create a new repository in the given directory | |
75 | locate locate files matching specific patterns |
|
75 | locate locate files matching specific patterns | |
76 | log show revision history of entire repository or files |
|
76 | log show revision history of entire repository or files | |
77 | manifest output the current or given revision of the project manifest |
|
77 | manifest output the current or given revision of the project manifest | |
78 | merge merge working directory with another revision |
|
78 | merge merge working directory with another revision | |
79 | outgoing show changesets not found in the destination |
|
79 | outgoing show changesets not found in the destination | |
80 | parents show the parents of the working directory or revision |
|
80 | parents show the parents of the working directory or revision | |
81 | paths show aliases for remote repositories |
|
81 | paths show aliases for remote repositories | |
82 | pull pull changes from the specified source |
|
82 | pull pull changes from the specified source | |
83 | push push changes to the specified destination |
|
83 | push push changes to the specified destination | |
84 | recover roll back an interrupted transaction |
|
84 | recover roll back an interrupted transaction | |
85 | remove remove the specified files on the next commit |
|
85 | remove remove the specified files on the next commit | |
86 | rename rename files; equivalent of copy + remove |
|
86 | rename rename files; equivalent of copy + remove | |
87 | resolve redo merges or set/view the merge status of files |
|
87 | resolve redo merges or set/view the merge status of files | |
88 | revert restore individual files or directories to an earlier state |
|
88 | revert restore individual files or directories to an earlier state | |
89 | rollback roll back the last transaction (dangerous) |
|
89 | rollback roll back the last transaction (dangerous) | |
90 | root print the root (top) of the current working directory |
|
90 | root print the root (top) of the current working directory | |
91 | serve start stand-alone webserver |
|
91 | serve start stand-alone webserver | |
92 | showconfig show combined config settings from all hgrc files |
|
92 | showconfig show combined config settings from all hgrc files | |
93 | status show changed files in the working directory |
|
93 | status show changed files in the working directory | |
94 | summary summarize working directory state |
|
94 | summary summarize working directory state | |
95 | tag add one or more tags for the current or given revision |
|
95 | tag add one or more tags for the current or given revision | |
96 | tags list repository tags |
|
96 | tags list repository tags | |
97 | tip show the tip revision |
|
97 | tip show the tip revision | |
98 | unbundle apply one or more changegroup files |
|
98 | unbundle apply one or more changegroup files | |
99 | update update working directory (or switch revisions) |
|
99 | update update working directory (or switch revisions) | |
100 | verify verify the integrity of the repository |
|
100 | verify verify the integrity of the repository | |
101 | version output version and copyright information |
|
101 | version output version and copyright information | |
102 |
|
102 | |||
103 | additional help topics: |
|
103 | additional help topics: | |
104 |
|
104 | |||
105 | config Configuration Files |
|
105 | config Configuration Files | |
106 | dates Date Formats |
|
106 | dates Date Formats | |
107 | patterns File Name Patterns |
|
107 | patterns File Name Patterns | |
108 | environment Environment Variables |
|
108 | environment Environment Variables | |
109 | revisions Specifying Single Revisions |
|
109 | revisions Specifying Single Revisions | |
110 | multirevs Specifying Multiple Revisions |
|
110 | multirevs Specifying Multiple Revisions | |
111 | revsets Specifying Revision Sets |
|
111 | revsets Specifying Revision Sets | |
112 | diffs Diff Formats |
|
112 | diffs Diff Formats | |
113 | merge-tools Merge Tools |
|
113 | merge-tools Merge Tools | |
114 | templating Template Usage |
|
114 | templating Template Usage | |
115 | urls URL Paths |
|
115 | urls URL Paths | |
116 | extensions Using additional features |
|
116 | extensions Using additional features | |
117 | hgweb Configuring hgweb |
|
117 | hgweb Configuring hgweb | |
118 | glossary Glossary |
|
118 | glossary Glossary | |
119 |
|
119 | |||
120 | use "hg -v help" to show aliases and global options |
|
120 | use "hg -v help" to show aliases and global options | |
121 |
|
121 | |||
122 | $ hg -q help |
|
122 | $ hg -q help | |
123 | add add the specified files on the next commit |
|
123 | add add the specified files on the next commit | |
124 | addremove add all new files, delete all missing files |
|
124 | addremove add all new files, delete all missing files | |
125 | annotate show changeset information by line for each file |
|
125 | annotate show changeset information by line for each file | |
126 | archive create an unversioned archive of a repository revision |
|
126 | archive create an unversioned archive of a repository revision | |
127 | backout reverse effect of earlier changeset |
|
127 | backout reverse effect of earlier changeset | |
128 | bisect subdivision search of changesets |
|
128 | bisect subdivision search of changesets | |
129 | branch set or show the current branch name |
|
129 | branch set or show the current branch name | |
130 | branches list repository named branches |
|
130 | branches list repository named branches | |
131 | bundle create a changegroup file |
|
131 | bundle create a changegroup file | |
132 | cat output the current or given revision of files |
|
132 | cat output the current or given revision of files | |
133 | clone make a copy of an existing repository |
|
133 | clone make a copy of an existing repository | |
134 | commit commit the specified files or all outstanding changes |
|
134 | commit commit the specified files or all outstanding changes | |
135 | copy mark files as copied for the next commit |
|
135 | copy mark files as copied for the next commit | |
136 | diff diff repository (or selected files) |
|
136 | diff diff repository (or selected files) | |
137 | export dump the header and diffs for one or more changesets |
|
137 | export dump the header and diffs for one or more changesets | |
138 | forget forget the specified files on the next commit |
|
138 | forget forget the specified files on the next commit | |
139 | grep search for a pattern in specified files and revisions |
|
139 | grep search for a pattern in specified files and revisions | |
140 | heads show current repository heads or show branch heads |
|
140 | heads show current repository heads or show branch heads | |
141 | help show help for a given topic or a help overview |
|
141 | help show help for a given topic or a help overview | |
142 | identify identify the working copy or specified revision |
|
142 | identify identify the working copy or specified revision | |
143 | import import an ordered set of patches |
|
143 | import import an ordered set of patches | |
144 | incoming show new changesets found in source |
|
144 | incoming show new changesets found in source | |
145 | init create a new repository in the given directory |
|
145 | init create a new repository in the given directory | |
146 | locate locate files matching specific patterns |
|
146 | locate locate files matching specific patterns | |
147 | log show revision history of entire repository or files |
|
147 | log show revision history of entire repository or files | |
148 | manifest output the current or given revision of the project manifest |
|
148 | manifest output the current or given revision of the project manifest | |
149 | merge merge working directory with another revision |
|
149 | merge merge working directory with another revision | |
150 | outgoing show changesets not found in the destination |
|
150 | outgoing show changesets not found in the destination | |
151 | parents show the parents of the working directory or revision |
|
151 | parents show the parents of the working directory or revision | |
152 | paths show aliases for remote repositories |
|
152 | paths show aliases for remote repositories | |
153 | pull pull changes from the specified source |
|
153 | pull pull changes from the specified source | |
154 | push push changes to the specified destination |
|
154 | push push changes to the specified destination | |
155 | recover roll back an interrupted transaction |
|
155 | recover roll back an interrupted transaction | |
156 | remove remove the specified files on the next commit |
|
156 | remove remove the specified files on the next commit | |
157 | rename rename files; equivalent of copy + remove |
|
157 | rename rename files; equivalent of copy + remove | |
158 | resolve redo merges or set/view the merge status of files |
|
158 | resolve redo merges or set/view the merge status of files | |
159 | revert restore individual files or directories to an earlier state |
|
159 | revert restore individual files or directories to an earlier state | |
160 | rollback roll back the last transaction (dangerous) |
|
160 | rollback roll back the last transaction (dangerous) | |
161 | root print the root (top) of the current working directory |
|
161 | root print the root (top) of the current working directory | |
162 | serve start stand-alone webserver |
|
162 | serve start stand-alone webserver | |
163 | showconfig show combined config settings from all hgrc files |
|
163 | showconfig show combined config settings from all hgrc files | |
164 | status show changed files in the working directory |
|
164 | status show changed files in the working directory | |
165 | summary summarize working directory state |
|
165 | summary summarize working directory state | |
166 | tag add one or more tags for the current or given revision |
|
166 | tag add one or more tags for the current or given revision | |
167 | tags list repository tags |
|
167 | tags list repository tags | |
168 | tip show the tip revision |
|
168 | tip show the tip revision | |
169 | unbundle apply one or more changegroup files |
|
169 | unbundle apply one or more changegroup files | |
170 | update update working directory (or switch revisions) |
|
170 | update update working directory (or switch revisions) | |
171 | verify verify the integrity of the repository |
|
171 | verify verify the integrity of the repository | |
172 | version output version and copyright information |
|
172 | version output version and copyright information | |
173 |
|
173 | |||
174 | additional help topics: |
|
174 | additional help topics: | |
175 |
|
175 | |||
176 | config Configuration Files |
|
176 | config Configuration Files | |
177 | dates Date Formats |
|
177 | dates Date Formats | |
178 | patterns File Name Patterns |
|
178 | patterns File Name Patterns | |
179 | environment Environment Variables |
|
179 | environment Environment Variables | |
180 | revisions Specifying Single Revisions |
|
180 | revisions Specifying Single Revisions | |
181 | multirevs Specifying Multiple Revisions |
|
181 | multirevs Specifying Multiple Revisions | |
182 | revsets Specifying Revision Sets |
|
182 | revsets Specifying Revision Sets | |
183 | diffs Diff Formats |
|
183 | diffs Diff Formats | |
184 | merge-tools Merge Tools |
|
184 | merge-tools Merge Tools | |
185 | templating Template Usage |
|
185 | templating Template Usage | |
186 | urls URL Paths |
|
186 | urls URL Paths | |
187 | extensions Using additional features |
|
187 | extensions Using additional features | |
188 | hgweb Configuring hgweb |
|
188 | hgweb Configuring hgweb | |
189 | glossary Glossary |
|
189 | glossary Glossary | |
190 |
|
190 | |||
191 | Test short command list with verbose option |
|
191 | Test short command list with verbose option | |
192 |
|
192 | |||
193 | $ hg -v help shortlist |
|
193 | $ hg -v help shortlist | |
194 | Mercurial Distributed SCM (version *) (glob) |
|
194 | Mercurial Distributed SCM (version *) (glob) | |
195 |
|
195 | |||
196 | Copyright (C) 2005-2010 Matt Mackall <mpm@selenic.com> and others |
|
196 | Copyright (C) 2005-2010 Matt Mackall <mpm@selenic.com> and others | |
197 | This is free software; see the source for copying conditions. There is NO |
|
197 | This is free software; see the source for copying conditions. There is NO | |
198 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
198 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
199 |
|
199 | |||
200 | basic commands: |
|
200 | basic commands: | |
201 |
|
201 | |||
202 | add: |
|
202 | add: | |
203 | add the specified files on the next commit |
|
203 | add the specified files on the next commit | |
204 | annotate, blame: |
|
204 | annotate, blame: | |
205 | show changeset information by line for each file |
|
205 | show changeset information by line for each file | |
206 | clone: |
|
206 | clone: | |
207 | make a copy of an existing repository |
|
207 | make a copy of an existing repository | |
208 | commit, ci: |
|
208 | commit, ci: | |
209 | commit the specified files or all outstanding changes |
|
209 | commit the specified files or all outstanding changes | |
210 | diff: |
|
210 | diff: | |
211 | diff repository (or selected files) |
|
211 | diff repository (or selected files) | |
212 | export: |
|
212 | export: | |
213 | dump the header and diffs for one or more changesets |
|
213 | dump the header and diffs for one or more changesets | |
214 | forget: |
|
214 | forget: | |
215 | forget the specified files on the next commit |
|
215 | forget the specified files on the next commit | |
216 | init: |
|
216 | init: | |
217 | create a new repository in the given directory |
|
217 | create a new repository in the given directory | |
218 | log, history: |
|
218 | log, history: | |
219 | show revision history of entire repository or files |
|
219 | show revision history of entire repository or files | |
220 | merge: |
|
220 | merge: | |
221 | merge working directory with another revision |
|
221 | merge working directory with another revision | |
222 | pull: |
|
222 | pull: | |
223 | pull changes from the specified source |
|
223 | pull changes from the specified source | |
224 | push: |
|
224 | push: | |
225 | push changes to the specified destination |
|
225 | push changes to the specified destination | |
226 | remove, rm: |
|
226 | remove, rm: | |
227 | remove the specified files on the next commit |
|
227 | remove the specified files on the next commit | |
228 | serve: |
|
228 | serve: | |
229 | start stand-alone webserver |
|
229 | start stand-alone webserver | |
230 | status, st: |
|
230 | status, st: | |
231 | show changed files in the working directory |
|
231 | show changed files in the working directory | |
232 | summary, sum: |
|
232 | summary, sum: | |
233 | summarize working directory state |
|
233 | summarize working directory state | |
234 | update, up, checkout, co: |
|
234 | update, up, checkout, co: | |
235 | update working directory (or switch revisions) |
|
235 | update working directory (or switch revisions) | |
236 |
|
236 | |||
237 | global options: |
|
237 | global options: | |
238 | -R --repository REPO repository root directory or name of overlay bundle |
|
238 | -R --repository REPO repository root directory or name of overlay bundle | |
239 | file |
|
239 | file | |
240 | --cwd DIR change working directory |
|
240 | --cwd DIR change working directory | |
241 | -y --noninteractive do not prompt, assume 'yes' for any required answers |
|
241 | -y --noninteractive do not prompt, assume 'yes' for any required answers | |
242 | -q --quiet suppress output |
|
242 | -q --quiet suppress output | |
243 | -v --verbose enable additional output |
|
243 | -v --verbose enable additional output | |
244 | --config CONFIG [+] set/override config option (use 'section.name=value') |
|
244 | --config CONFIG [+] set/override config option (use 'section.name=value') | |
245 | --debug enable debugging output |
|
245 | --debug enable debugging output | |
246 | --debugger start debugger |
|
246 | --debugger start debugger | |
247 | --encoding ENCODE set the charset encoding (default: ascii) |
|
247 | --encoding ENCODE set the charset encoding (default: ascii) | |
248 | --encodingmode MODE set the charset encoding mode (default: strict) |
|
248 | --encodingmode MODE set the charset encoding mode (default: strict) | |
249 | --traceback always print a traceback on exception |
|
249 | --traceback always print a traceback on exception | |
250 | --time time how long the command takes |
|
250 | --time time how long the command takes | |
251 | --profile print command execution profile |
|
251 | --profile print command execution profile | |
252 | --version output version information and exit |
|
252 | --version output version information and exit | |
253 | -h --help display help and exit |
|
253 | -h --help display help and exit | |
254 |
|
254 | |||
255 | [+] marked option can be specified multiple times |
|
255 | [+] marked option can be specified multiple times | |
256 |
|
256 | |||
257 | use "hg help" for the full list of commands |
|
257 | use "hg help" for the full list of commands | |
258 |
|
258 | |||
259 | $ hg add -h |
|
259 | $ hg add -h | |
260 | hg add [OPTION]... [FILE]... |
|
260 | hg add [OPTION]... [FILE]... | |
261 |
|
261 | |||
262 | add the specified files on the next commit |
|
262 | add the specified files on the next commit | |
263 |
|
263 | |||
264 | Schedule files to be version controlled and added to the repository. |
|
264 | Schedule files to be version controlled and added to the repository. | |
265 |
|
265 | |||
266 | The files will be added to the repository at the next commit. To undo an |
|
266 | The files will be added to the repository at the next commit. To undo an | |
267 | add before that, see "hg forget". |
|
267 | add before that, see "hg forget". | |
268 |
|
268 | |||
269 | If no names are given, add all files to the repository. |
|
269 | If no names are given, add all files to the repository. | |
270 |
|
270 | |||
271 | Returns 0 if all files are successfully added. |
|
271 | Returns 0 if all files are successfully added. | |
272 |
|
272 | |||
273 | use "hg -v help add" to show verbose help |
|
273 | use "hg -v help add" to show verbose help | |
274 |
|
274 | |||
275 | options: |
|
275 | options: | |
276 |
|
276 | |||
277 | -I --include PATTERN [+] include names matching the given patterns |
|
277 | -I --include PATTERN [+] include names matching the given patterns | |
278 | -X --exclude PATTERN [+] exclude names matching the given patterns |
|
278 | -X --exclude PATTERN [+] exclude names matching the given patterns | |
279 | -S --subrepos recurse into subrepositories |
|
279 | -S --subrepos recurse into subrepositories | |
280 | -n --dry-run do not perform actions, just print output |
|
280 | -n --dry-run do not perform actions, just print output | |
281 |
|
281 | |||
282 | [+] marked option can be specified multiple times |
|
282 | [+] marked option can be specified multiple times | |
283 |
|
283 | |||
284 | use "hg -v help add" to show global options |
|
284 | use "hg -v help add" to show global options | |
285 |
|
285 | |||
286 | Verbose help for add |
|
286 | Verbose help for add | |
287 |
|
287 | |||
288 | $ hg add -hv |
|
288 | $ hg add -hv | |
289 | hg add [OPTION]... [FILE]... |
|
289 | hg add [OPTION]... [FILE]... | |
290 |
|
290 | |||
291 | add the specified files on the next commit |
|
291 | add the specified files on the next commit | |
292 |
|
292 | |||
293 | Schedule files to be version controlled and added to the repository. |
|
293 | Schedule files to be version controlled and added to the repository. | |
294 |
|
294 | |||
295 | The files will be added to the repository at the next commit. To undo an |
|
295 | The files will be added to the repository at the next commit. To undo an | |
296 | add before that, see "hg forget". |
|
296 | add before that, see "hg forget". | |
297 |
|
297 | |||
298 | If no names are given, add all files to the repository. |
|
298 | If no names are given, add all files to the repository. | |
299 |
|
299 | |||
300 | An example showing how new (unknown) files are added automatically by "hg |
|
300 | An example showing how new (unknown) files are added automatically by "hg | |
301 | add": |
|
301 | add": | |
302 |
|
302 | |||
303 | $ ls |
|
303 | $ ls | |
304 | foo.c |
|
304 | foo.c | |
305 | $ hg status |
|
305 | $ hg status | |
306 | ? foo.c |
|
306 | ? foo.c | |
307 | $ hg add |
|
307 | $ hg add | |
308 | adding foo.c |
|
308 | adding foo.c | |
309 | $ hg status |
|
309 | $ hg status | |
310 | A foo.c |
|
310 | A foo.c | |
311 |
|
311 | |||
312 | Returns 0 if all files are successfully added. |
|
312 | Returns 0 if all files are successfully added. | |
313 |
|
313 | |||
314 | options: |
|
314 | options: | |
315 |
|
315 | |||
316 | -I --include PATTERN [+] include names matching the given patterns |
|
316 | -I --include PATTERN [+] include names matching the given patterns | |
317 | -X --exclude PATTERN [+] exclude names matching the given patterns |
|
317 | -X --exclude PATTERN [+] exclude names matching the given patterns | |
318 | -S --subrepos recurse into subrepositories |
|
318 | -S --subrepos recurse into subrepositories | |
319 | -n --dry-run do not perform actions, just print output |
|
319 | -n --dry-run do not perform actions, just print output | |
320 |
|
320 | |||
321 | global options: |
|
321 | global options: | |
322 | -R --repository REPO repository root directory or name of overlay bundle |
|
322 | -R --repository REPO repository root directory or name of overlay bundle | |
323 | file |
|
323 | file | |
324 | --cwd DIR change working directory |
|
324 | --cwd DIR change working directory | |
325 | -y --noninteractive do not prompt, assume 'yes' for any required |
|
325 | -y --noninteractive do not prompt, assume 'yes' for any required | |
326 | answers |
|
326 | answers | |
327 | -q --quiet suppress output |
|
327 | -q --quiet suppress output | |
328 | -v --verbose enable additional output |
|
328 | -v --verbose enable additional output | |
329 | --config CONFIG [+] set/override config option (use |
|
329 | --config CONFIG [+] set/override config option (use | |
330 | 'section.name=value') |
|
330 | 'section.name=value') | |
331 | --debug enable debugging output |
|
331 | --debug enable debugging output | |
332 | --debugger start debugger |
|
332 | --debugger start debugger | |
333 | --encoding ENCODE set the charset encoding (default: ascii) |
|
333 | --encoding ENCODE set the charset encoding (default: ascii) | |
334 | --encodingmode MODE set the charset encoding mode (default: strict) |
|
334 | --encodingmode MODE set the charset encoding mode (default: strict) | |
335 | --traceback always print a traceback on exception |
|
335 | --traceback always print a traceback on exception | |
336 | --time time how long the command takes |
|
336 | --time time how long the command takes | |
337 | --profile print command execution profile |
|
337 | --profile print command execution profile | |
338 | --version output version information and exit |
|
338 | --version output version information and exit | |
339 | -h --help display help and exit |
|
339 | -h --help display help and exit | |
340 |
|
340 | |||
341 | [+] marked option can be specified multiple times |
|
341 | [+] marked option can be specified multiple times | |
342 |
|
342 | |||
343 | Test help option with version option |
|
343 | Test help option with version option | |
344 |
|
344 | |||
345 | $ hg add -h --version |
|
345 | $ hg add -h --version | |
346 | Mercurial Distributed SCM (version *) (glob) |
|
346 | Mercurial Distributed SCM (version *) (glob) | |
347 |
|
347 | |||
348 | Copyright (C) 2005-2010 Matt Mackall <mpm@selenic.com> and others |
|
348 | Copyright (C) 2005-2010 Matt Mackall <mpm@selenic.com> and others | |
349 | This is free software; see the source for copying conditions. There is NO |
|
349 | This is free software; see the source for copying conditions. There is NO | |
350 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
350 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
351 |
|
351 | |||
352 | hg add [OPTION]... [FILE]... |
|
352 | hg add [OPTION]... [FILE]... | |
353 |
|
353 | |||
354 | add the specified files on the next commit |
|
354 | add the specified files on the next commit | |
355 |
|
355 | |||
356 | Schedule files to be version controlled and added to the repository. |
|
356 | Schedule files to be version controlled and added to the repository. | |
357 |
|
357 | |||
358 | The files will be added to the repository at the next commit. To undo an |
|
358 | The files will be added to the repository at the next commit. To undo an | |
359 | add before that, see "hg forget". |
|
359 | add before that, see "hg forget". | |
360 |
|
360 | |||
361 | If no names are given, add all files to the repository. |
|
361 | If no names are given, add all files to the repository. | |
362 |
|
362 | |||
363 | Returns 0 if all files are successfully added. |
|
363 | Returns 0 if all files are successfully added. | |
364 |
|
364 | |||
365 | use "hg -v help add" to show verbose help |
|
365 | use "hg -v help add" to show verbose help | |
366 |
|
366 | |||
367 | options: |
|
367 | options: | |
368 |
|
368 | |||
369 | -I --include PATTERN [+] include names matching the given patterns |
|
369 | -I --include PATTERN [+] include names matching the given patterns | |
370 | -X --exclude PATTERN [+] exclude names matching the given patterns |
|
370 | -X --exclude PATTERN [+] exclude names matching the given patterns | |
371 | -S --subrepos recurse into subrepositories |
|
371 | -S --subrepos recurse into subrepositories | |
372 | -n --dry-run do not perform actions, just print output |
|
372 | -n --dry-run do not perform actions, just print output | |
373 |
|
373 | |||
374 | [+] marked option can be specified multiple times |
|
374 | [+] marked option can be specified multiple times | |
375 |
|
375 | |||
376 | use "hg -v help add" to show global options |
|
376 | use "hg -v help add" to show global options | |
377 |
|
377 | |||
378 | $ hg add --skjdfks |
|
378 | $ hg add --skjdfks | |
379 | hg add: option --skjdfks not recognized |
|
379 | hg add: option --skjdfks not recognized | |
380 | hg add [OPTION]... [FILE]... |
|
380 | hg add [OPTION]... [FILE]... | |
381 |
|
381 | |||
382 | add the specified files on the next commit |
|
382 | add the specified files on the next commit | |
383 |
|
383 | |||
384 | Schedule files to be version controlled and added to the repository. |
|
384 | Schedule files to be version controlled and added to the repository. | |
385 |
|
385 | |||
386 | The files will be added to the repository at the next commit. To undo an |
|
386 | The files will be added to the repository at the next commit. To undo an | |
387 | add before that, see "hg forget". |
|
387 | add before that, see "hg forget". | |
388 |
|
388 | |||
389 | If no names are given, add all files to the repository. |
|
389 | If no names are given, add all files to the repository. | |
390 |
|
390 | |||
391 | Returns 0 if all files are successfully added. |
|
391 | Returns 0 if all files are successfully added. | |
392 |
|
392 | |||
393 | use "hg -v help add" to show verbose help |
|
393 | use "hg -v help add" to show verbose help | |
394 |
|
394 | |||
395 | options: |
|
395 | options: | |
396 |
|
396 | |||
397 | -I --include PATTERN [+] include names matching the given patterns |
|
397 | -I --include PATTERN [+] include names matching the given patterns | |
398 | -X --exclude PATTERN [+] exclude names matching the given patterns |
|
398 | -X --exclude PATTERN [+] exclude names matching the given patterns | |
399 | -S --subrepos recurse into subrepositories |
|
399 | -S --subrepos recurse into subrepositories | |
400 | -n --dry-run do not perform actions, just print output |
|
400 | -n --dry-run do not perform actions, just print output | |
401 |
|
401 | |||
402 | [+] marked option can be specified multiple times |
|
402 | [+] marked option can be specified multiple times | |
403 |
|
403 | |||
404 | use "hg -v help add" to show global options |
|
404 | use "hg -v help add" to show global options | |
405 | [255] |
|
405 | [255] | |
406 |
|
406 | |||
407 | Test ambiguous command help |
|
407 | Test ambiguous command help | |
408 |
|
408 | |||
409 | $ hg help ad |
|
409 | $ hg help ad | |
410 | list of commands: |
|
410 | list of commands: | |
411 |
|
411 | |||
412 | add add the specified files on the next commit |
|
412 | add add the specified files on the next commit | |
413 | addremove add all new files, delete all missing files |
|
413 | addremove add all new files, delete all missing files | |
414 |
|
414 | |||
415 | use "hg -v help ad" to show aliases and global options |
|
415 | use "hg -v help ad" to show aliases and global options | |
416 |
|
416 | |||
417 | Test command without options |
|
417 | Test command without options | |
418 |
|
418 | |||
419 | $ hg help verify |
|
419 | $ hg help verify | |
420 | hg verify |
|
420 | hg verify | |
421 |
|
421 | |||
422 | verify the integrity of the repository |
|
422 | verify the integrity of the repository | |
423 |
|
423 | |||
424 | Verify the integrity of the current repository. |
|
424 | Verify the integrity of the current repository. | |
425 |
|
425 | |||
426 | This will perform an extensive check of the repository's integrity, |
|
426 | This will perform an extensive check of the repository's integrity, | |
427 | validating the hashes and checksums of each entry in the changelog, |
|
427 | validating the hashes and checksums of each entry in the changelog, | |
428 | manifest, and tracked files, as well as the integrity of their crosslinks |
|
428 | manifest, and tracked files, as well as the integrity of their crosslinks | |
429 | and indices. |
|
429 | and indices. | |
430 |
|
430 | |||
431 | Returns 0 on success, 1 if errors are encountered. |
|
431 | Returns 0 on success, 1 if errors are encountered. | |
432 |
|
432 | |||
433 | use "hg -v help verify" to show global options |
|
433 | use "hg -v help verify" to show global options | |
434 |
|
434 | |||
435 | $ hg help diff |
|
435 | $ hg help diff | |
436 | hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]... |
|
436 | hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]... | |
437 |
|
437 | |||
438 | diff repository (or selected files) |
|
438 | diff repository (or selected files) | |
439 |
|
439 | |||
440 | Show differences between revisions for the specified files. |
|
440 | Show differences between revisions for the specified files. | |
441 |
|
441 | |||
442 | Differences between files are shown using the unified diff format. |
|
442 | Differences between files are shown using the unified diff format. | |
443 |
|
443 | |||
444 | Note: |
|
444 | Note: | |
445 | diff may generate unexpected results for merges, as it will default to |
|
445 | diff may generate unexpected results for merges, as it will default to | |
446 | comparing against the working directory's first parent changeset if no |
|
446 | comparing against the working directory's first parent changeset if no | |
447 | revisions are specified. |
|
447 | revisions are specified. | |
448 |
|
448 | |||
449 | When two revision arguments are given, then changes are shown between |
|
449 | When two revision arguments are given, then changes are shown between | |
450 | those revisions. If only one revision is specified then that revision is |
|
450 | those revisions. If only one revision is specified then that revision is | |
451 | compared to the working directory, and, when no revisions are specified, |
|
451 | compared to the working directory, and, when no revisions are specified, | |
452 | the working directory files are compared to its parent. |
|
452 | the working directory files are compared to its parent. | |
453 |
|
453 | |||
454 | Alternatively you can specify -c/--change with a revision to see the |
|
454 | Alternatively you can specify -c/--change with a revision to see the | |
455 | changes in that changeset relative to its first parent. |
|
455 | changes in that changeset relative to its first parent. | |
456 |
|
456 | |||
457 | Without the -a/--text option, diff will avoid generating diffs of files it |
|
457 | Without the -a/--text option, diff will avoid generating diffs of files it | |
458 | detects as binary. With -a, diff will generate a diff anyway, probably |
|
458 | detects as binary. With -a, diff will generate a diff anyway, probably | |
459 | with undesirable results. |
|
459 | with undesirable results. | |
460 |
|
460 | |||
461 | Use the -g/--git option to generate diffs in the git extended diff format. |
|
461 | Use the -g/--git option to generate diffs in the git extended diff format. | |
462 | For more information, read "hg help diffs". |
|
462 | For more information, read "hg help diffs". | |
463 |
|
463 | |||
464 | Returns 0 on success. |
|
464 | Returns 0 on success. | |
465 |
|
465 | |||
466 | options: |
|
466 | options: | |
467 |
|
467 | |||
468 | -r --rev REV [+] revision |
|
468 | -r --rev REV [+] revision | |
469 | -c --change REV change made by revision |
|
469 | -c --change REV change made by revision | |
470 | -a --text treat all files as text |
|
470 | -a --text treat all files as text | |
471 | -g --git use git extended diff format |
|
471 | -g --git use git extended diff format | |
472 | --nodates omit dates from diff headers |
|
472 | --nodates omit dates from diff headers | |
473 | -p --show-function show which function each change is in |
|
473 | -p --show-function show which function each change is in | |
474 | --reverse produce a diff that undoes the changes |
|
474 | --reverse produce a diff that undoes the changes | |
475 | -w --ignore-all-space ignore white space when comparing lines |
|
475 | -w --ignore-all-space ignore white space when comparing lines | |
476 | -b --ignore-space-change ignore changes in the amount of white space |
|
476 | -b --ignore-space-change ignore changes in the amount of white space | |
477 | -B --ignore-blank-lines ignore changes whose lines are all blank |
|
477 | -B --ignore-blank-lines ignore changes whose lines are all blank | |
478 | -U --unified NUM number of lines of context to show |
|
478 | -U --unified NUM number of lines of context to show | |
479 | --stat output diffstat-style summary of changes |
|
479 | --stat output diffstat-style summary of changes | |
480 | -I --include PATTERN [+] include names matching the given patterns |
|
480 | -I --include PATTERN [+] include names matching the given patterns | |
481 | -X --exclude PATTERN [+] exclude names matching the given patterns |
|
481 | -X --exclude PATTERN [+] exclude names matching the given patterns | |
482 | -S --subrepos recurse into subrepositories |
|
482 | -S --subrepos recurse into subrepositories | |
483 |
|
483 | |||
484 | [+] marked option can be specified multiple times |
|
484 | [+] marked option can be specified multiple times | |
485 |
|
485 | |||
486 | use "hg -v help diff" to show global options |
|
486 | use "hg -v help diff" to show global options | |
487 |
|
487 | |||
488 | $ hg help status |
|
488 | $ hg help status | |
489 | hg status [OPTION]... [FILE]... |
|
489 | hg status [OPTION]... [FILE]... | |
490 |
|
490 | |||
491 | aliases: st |
|
491 | aliases: st | |
492 |
|
492 | |||
493 | show changed files in the working directory |
|
493 | show changed files in the working directory | |
494 |
|
494 | |||
495 | Show status of files in the repository. If names are given, only files |
|
495 | Show status of files in the repository. If names are given, only files | |
496 | that match are shown. Files that are clean or ignored or the source of a |
|
496 | that match are shown. Files that are clean or ignored or the source of a | |
497 | copy/move operation, are not listed unless -c/--clean, -i/--ignored, |
|
497 | copy/move operation, are not listed unless -c/--clean, -i/--ignored, | |
498 | -C/--copies or -A/--all are given. Unless options described with "show |
|
498 | -C/--copies or -A/--all are given. Unless options described with "show | |
499 | only ..." are given, the options -mardu are used. |
|
499 | only ..." are given, the options -mardu are used. | |
500 |
|
500 | |||
501 | Option -q/--quiet hides untracked (unknown and ignored) files unless |
|
501 | Option -q/--quiet hides untracked (unknown and ignored) files unless | |
502 | explicitly requested with -u/--unknown or -i/--ignored. |
|
502 | explicitly requested with -u/--unknown or -i/--ignored. | |
503 |
|
503 | |||
504 | Note: |
|
504 | Note: | |
505 | status may appear to disagree with diff if permissions have changed or |
|
505 | status may appear to disagree with diff if permissions have changed or | |
506 | a merge has occurred. The standard diff format does not report |
|
506 | a merge has occurred. The standard diff format does not report | |
507 | permission changes and diff only reports changes relative to one merge |
|
507 | permission changes and diff only reports changes relative to one merge | |
508 | parent. |
|
508 | parent. | |
509 |
|
509 | |||
510 | If one revision is given, it is used as the base revision. If two |
|
510 | If one revision is given, it is used as the base revision. If two | |
511 | revisions are given, the differences between them are shown. The --change |
|
511 | revisions are given, the differences between them are shown. The --change | |
512 | option can also be used as a shortcut to list the changed files of a |
|
512 | option can also be used as a shortcut to list the changed files of a | |
513 | revision from its first parent. |
|
513 | revision from its first parent. | |
514 |
|
514 | |||
515 | The codes used to show the status of files are: |
|
515 | The codes used to show the status of files are: | |
516 |
|
516 | |||
517 | M = modified |
|
517 | M = modified | |
518 | A = added |
|
518 | A = added | |
519 | R = removed |
|
519 | R = removed | |
520 | C = clean |
|
520 | C = clean | |
521 | ! = missing (deleted by non-hg command, but still tracked) |
|
521 | ! = missing (deleted by non-hg command, but still tracked) | |
522 | ? = not tracked |
|
522 | ? = not tracked | |
523 | I = ignored |
|
523 | I = ignored | |
524 | = origin of the previous file listed as A (added) |
|
524 | = origin of the previous file listed as A (added) | |
525 |
|
525 | |||
526 | Returns 0 on success. |
|
526 | Returns 0 on success. | |
527 |
|
527 | |||
528 | options: |
|
528 | options: | |
529 |
|
529 | |||
530 | -A --all show status of all files |
|
530 | -A --all show status of all files | |
531 | -m --modified show only modified files |
|
531 | -m --modified show only modified files | |
532 | -a --added show only added files |
|
532 | -a --added show only added files | |
533 | -r --removed show only removed files |
|
533 | -r --removed show only removed files | |
534 | -d --deleted show only deleted (but tracked) files |
|
534 | -d --deleted show only deleted (but tracked) files | |
535 | -c --clean show only files without changes |
|
535 | -c --clean show only files without changes | |
536 | -u --unknown show only unknown (not tracked) files |
|
536 | -u --unknown show only unknown (not tracked) files | |
537 | -i --ignored show only ignored files |
|
537 | -i --ignored show only ignored files | |
538 | -n --no-status hide status prefix |
|
538 | -n --no-status hide status prefix | |
539 | -C --copies show source of copied files |
|
539 | -C --copies show source of copied files | |
540 | -0 --print0 end filenames with NUL, for use with xargs |
|
540 | -0 --print0 end filenames with NUL, for use with xargs | |
541 | --rev REV [+] show difference from revision |
|
541 | --rev REV [+] show difference from revision | |
542 | --change REV list the changed files of a revision |
|
542 | --change REV list the changed files of a revision | |
543 | -I --include PATTERN [+] include names matching the given patterns |
|
543 | -I --include PATTERN [+] include names matching the given patterns | |
544 | -X --exclude PATTERN [+] exclude names matching the given patterns |
|
544 | -X --exclude PATTERN [+] exclude names matching the given patterns | |
545 | -S --subrepos recurse into subrepositories |
|
545 | -S --subrepos recurse into subrepositories | |
546 |
|
546 | |||
547 | [+] marked option can be specified multiple times |
|
547 | [+] marked option can be specified multiple times | |
548 |
|
548 | |||
549 | use "hg -v help status" to show global options |
|
549 | use "hg -v help status" to show global options | |
550 |
|
550 | |||
551 | $ hg -q help status |
|
551 | $ hg -q help status | |
552 | hg status [OPTION]... [FILE]... |
|
552 | hg status [OPTION]... [FILE]... | |
553 |
|
553 | |||
554 | show changed files in the working directory |
|
554 | show changed files in the working directory | |
555 |
|
555 | |||
556 | $ hg help foo |
|
556 | $ hg help foo | |
557 | hg: unknown command 'foo' |
|
557 | hg: unknown command 'foo' | |
558 | Mercurial Distributed SCM |
|
558 | Mercurial Distributed SCM | |
559 |
|
559 | |||
560 | basic commands: |
|
560 | basic commands: | |
561 |
|
561 | |||
562 | add add the specified files on the next commit |
|
562 | add add the specified files on the next commit | |
563 | annotate show changeset information by line for each file |
|
563 | annotate show changeset information by line for each file | |
564 | clone make a copy of an existing repository |
|
564 | clone make a copy of an existing repository | |
565 | commit commit the specified files or all outstanding changes |
|
565 | commit commit the specified files or all outstanding changes | |
566 | diff diff repository (or selected files) |
|
566 | diff diff repository (or selected files) | |
567 | export dump the header and diffs for one or more changesets |
|
567 | export dump the header and diffs for one or more changesets | |
568 | forget forget the specified files on the next commit |
|
568 | forget forget the specified files on the next commit | |
569 | init create a new repository in the given directory |
|
569 | init create a new repository in the given directory | |
570 | log show revision history of entire repository or files |
|
570 | log show revision history of entire repository or files | |
571 | merge merge working directory with another revision |
|
571 | merge merge working directory with another revision | |
572 | pull pull changes from the specified source |
|
572 | pull pull changes from the specified source | |
573 | push push changes to the specified destination |
|
573 | push push changes to the specified destination | |
574 | remove remove the specified files on the next commit |
|
574 | remove remove the specified files on the next commit | |
575 | serve start stand-alone webserver |
|
575 | serve start stand-alone webserver | |
576 | status show changed files in the working directory |
|
576 | status show changed files in the working directory | |
577 | summary summarize working directory state |
|
577 | summary summarize working directory state | |
578 | update update working directory (or switch revisions) |
|
578 | update update working directory (or switch revisions) | |
579 |
|
579 | |||
580 | use "hg help" for the full list of commands or "hg -v" for details |
|
580 | use "hg help" for the full list of commands or "hg -v" for details | |
581 | [255] |
|
581 | [255] | |
582 |
|
582 | |||
583 | $ hg skjdfks |
|
583 | $ hg skjdfks | |
584 | hg: unknown command 'skjdfks' |
|
584 | hg: unknown command 'skjdfks' | |
585 | Mercurial Distributed SCM |
|
585 | Mercurial Distributed SCM | |
586 |
|
586 | |||
587 | basic commands: |
|
587 | basic commands: | |
588 |
|
588 | |||
589 | add add the specified files on the next commit |
|
589 | add add the specified files on the next commit | |
590 | annotate show changeset information by line for each file |
|
590 | annotate show changeset information by line for each file | |
591 | clone make a copy of an existing repository |
|
591 | clone make a copy of an existing repository | |
592 | commit commit the specified files or all outstanding changes |
|
592 | commit commit the specified files or all outstanding changes | |
593 | diff diff repository (or selected files) |
|
593 | diff diff repository (or selected files) | |
594 | export dump the header and diffs for one or more changesets |
|
594 | export dump the header and diffs for one or more changesets | |
595 | forget forget the specified files on the next commit |
|
595 | forget forget the specified files on the next commit | |
596 | init create a new repository in the given directory |
|
596 | init create a new repository in the given directory | |
597 | log show revision history of entire repository or files |
|
597 | log show revision history of entire repository or files | |
598 | merge merge working directory with another revision |
|
598 | merge merge working directory with another revision | |
599 | pull pull changes from the specified source |
|
599 | pull pull changes from the specified source | |
600 | push push changes to the specified destination |
|
600 | push push changes to the specified destination | |
601 | remove remove the specified files on the next commit |
|
601 | remove remove the specified files on the next commit | |
602 | serve start stand-alone webserver |
|
602 | serve start stand-alone webserver | |
603 | status show changed files in the working directory |
|
603 | status show changed files in the working directory | |
604 | summary summarize working directory state |
|
604 | summary summarize working directory state | |
605 | update update working directory (or switch revisions) |
|
605 | update update working directory (or switch revisions) | |
606 |
|
606 | |||
607 | use "hg help" for the full list of commands or "hg -v" for details |
|
607 | use "hg help" for the full list of commands or "hg -v" for details | |
608 | [255] |
|
608 | [255] | |
609 |
|
609 | |||
610 | $ cat > helpext.py <<EOF |
|
610 | $ cat > helpext.py <<EOF | |
611 | > import os |
|
611 | > import os | |
612 | > from mercurial import commands |
|
612 | > from mercurial import commands | |
613 | > |
|
613 | > | |
614 | > def nohelp(ui, *args, **kwargs): |
|
614 | > def nohelp(ui, *args, **kwargs): | |
615 | > pass |
|
615 | > pass | |
616 | > |
|
616 | > | |
617 | > cmdtable = { |
|
617 | > cmdtable = { | |
618 | > "nohelp": (nohelp, [], "hg nohelp"), |
|
618 | > "nohelp": (nohelp, [], "hg nohelp"), | |
619 | > } |
|
619 | > } | |
620 | > |
|
620 | > | |
621 | > commands.norepo += ' nohelp' |
|
621 | > commands.norepo += ' nohelp' | |
622 | > EOF |
|
622 | > EOF | |
623 | $ echo '[extensions]' >> $HGRCPATH |
|
623 | $ echo '[extensions]' >> $HGRCPATH | |
624 | $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH |
|
624 | $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH | |
625 |
|
625 | |||
626 | Test command with no help text |
|
626 | Test command with no help text | |
627 |
|
627 | |||
628 | $ hg help nohelp |
|
628 | $ hg help nohelp | |
629 | hg nohelp |
|
629 | hg nohelp | |
630 |
|
630 | |||
631 | (no help text available) |
|
631 | (no help text available) | |
632 |
|
632 | |||
633 | use "hg -v help nohelp" to show global options |
|
633 | use "hg -v help nohelp" to show global options | |
634 |
|
634 | |||
635 | Test that default list of commands omits extension commands |
|
635 | Test that default list of commands omits extension commands | |
636 |
|
636 | |||
637 | $ hg help |
|
637 | $ hg help | |
638 | Mercurial Distributed SCM |
|
638 | Mercurial Distributed SCM | |
639 |
|
639 | |||
640 | list of commands: |
|
640 | list of commands: | |
641 |
|
641 | |||
642 | add add the specified files on the next commit |
|
642 | add add the specified files on the next commit | |
643 | addremove add all new files, delete all missing files |
|
643 | addremove add all new files, delete all missing files | |
644 | annotate show changeset information by line for each file |
|
644 | annotate show changeset information by line for each file | |
645 | archive create an unversioned archive of a repository revision |
|
645 | archive create an unversioned archive of a repository revision | |
646 | backout reverse effect of earlier changeset |
|
646 | backout reverse effect of earlier changeset | |
647 | bisect subdivision search of changesets |
|
647 | bisect subdivision search of changesets | |
648 | branch set or show the current branch name |
|
648 | branch set or show the current branch name | |
649 | branches list repository named branches |
|
649 | branches list repository named branches | |
650 | bundle create a changegroup file |
|
650 | bundle create a changegroup file | |
651 | cat output the current or given revision of files |
|
651 | cat output the current or given revision of files | |
652 | clone make a copy of an existing repository |
|
652 | clone make a copy of an existing repository | |
653 | commit commit the specified files or all outstanding changes |
|
653 | commit commit the specified files or all outstanding changes | |
654 | copy mark files as copied for the next commit |
|
654 | copy mark files as copied for the next commit | |
655 | diff diff repository (or selected files) |
|
655 | diff diff repository (or selected files) | |
656 | export dump the header and diffs for one or more changesets |
|
656 | export dump the header and diffs for one or more changesets | |
657 | forget forget the specified files on the next commit |
|
657 | forget forget the specified files on the next commit | |
658 | grep search for a pattern in specified files and revisions |
|
658 | grep search for a pattern in specified files and revisions | |
659 | heads show current repository heads or show branch heads |
|
659 | heads show current repository heads or show branch heads | |
660 | help show help for a given topic or a help overview |
|
660 | help show help for a given topic or a help overview | |
661 | identify identify the working copy or specified revision |
|
661 | identify identify the working copy or specified revision | |
662 | import import an ordered set of patches |
|
662 | import import an ordered set of patches | |
663 | incoming show new changesets found in source |
|
663 | incoming show new changesets found in source | |
664 | init create a new repository in the given directory |
|
664 | init create a new repository in the given directory | |
665 | locate locate files matching specific patterns |
|
665 | locate locate files matching specific patterns | |
666 | log show revision history of entire repository or files |
|
666 | log show revision history of entire repository or files | |
667 | manifest output the current or given revision of the project manifest |
|
667 | manifest output the current or given revision of the project manifest | |
668 | merge merge working directory with another revision |
|
668 | merge merge working directory with another revision | |
669 | outgoing show changesets not found in the destination |
|
669 | outgoing show changesets not found in the destination | |
670 | parents show the parents of the working directory or revision |
|
670 | parents show the parents of the working directory or revision | |
671 | paths show aliases for remote repositories |
|
671 | paths show aliases for remote repositories | |
672 | pull pull changes from the specified source |
|
672 | pull pull changes from the specified source | |
673 | push push changes to the specified destination |
|
673 | push push changes to the specified destination | |
674 | recover roll back an interrupted transaction |
|
674 | recover roll back an interrupted transaction | |
675 | remove remove the specified files on the next commit |
|
675 | remove remove the specified files on the next commit | |
676 | rename rename files; equivalent of copy + remove |
|
676 | rename rename files; equivalent of copy + remove | |
677 | resolve redo merges or set/view the merge status of files |
|
677 | resolve redo merges or set/view the merge status of files | |
678 | revert restore individual files or directories to an earlier state |
|
678 | revert restore individual files or directories to an earlier state | |
679 | rollback roll back the last transaction (dangerous) |
|
679 | rollback roll back the last transaction (dangerous) | |
680 | root print the root (top) of the current working directory |
|
680 | root print the root (top) of the current working directory | |
681 | serve start stand-alone webserver |
|
681 | serve start stand-alone webserver | |
682 | showconfig show combined config settings from all hgrc files |
|
682 | showconfig show combined config settings from all hgrc files | |
683 | status show changed files in the working directory |
|
683 | status show changed files in the working directory | |
684 | summary summarize working directory state |
|
684 | summary summarize working directory state | |
685 | tag add one or more tags for the current or given revision |
|
685 | tag add one or more tags for the current or given revision | |
686 | tags list repository tags |
|
686 | tags list repository tags | |
687 | tip show the tip revision |
|
687 | tip show the tip revision | |
688 | unbundle apply one or more changegroup files |
|
688 | unbundle apply one or more changegroup files | |
689 | update update working directory (or switch revisions) |
|
689 | update update working directory (or switch revisions) | |
690 | verify verify the integrity of the repository |
|
690 | verify verify the integrity of the repository | |
691 | version output version and copyright information |
|
691 | version output version and copyright information | |
692 |
|
692 | |||
693 | enabled extensions: |
|
693 | enabled extensions: | |
694 |
|
694 | |||
695 | helpext (no help text available) |
|
695 | helpext (no help text available) | |
696 |
|
696 | |||
697 | additional help topics: |
|
697 | additional help topics: | |
698 |
|
698 | |||
699 | config Configuration Files |
|
699 | config Configuration Files | |
700 | dates Date Formats |
|
700 | dates Date Formats | |
701 | patterns File Name Patterns |
|
701 | patterns File Name Patterns | |
702 | environment Environment Variables |
|
702 | environment Environment Variables | |
703 | revisions Specifying Single Revisions |
|
703 | revisions Specifying Single Revisions | |
704 | multirevs Specifying Multiple Revisions |
|
704 | multirevs Specifying Multiple Revisions | |
705 | revsets Specifying Revision Sets |
|
705 | revsets Specifying Revision Sets | |
706 | diffs Diff Formats |
|
706 | diffs Diff Formats | |
707 | merge-tools Merge Tools |
|
707 | merge-tools Merge Tools | |
708 | templating Template Usage |
|
708 | templating Template Usage | |
709 | urls URL Paths |
|
709 | urls URL Paths | |
710 | extensions Using additional features |
|
710 | extensions Using additional features | |
711 | hgweb Configuring hgweb |
|
711 | hgweb Configuring hgweb | |
712 | glossary Glossary |
|
712 | glossary Glossary | |
713 |
|
713 | |||
714 | use "hg -v help" to show aliases and global options |
|
714 | use "hg -v help" to show aliases and global options | |
715 |
|
715 | |||
716 | Test list of commands with command with no help text |
|
716 | Test list of commands with command with no help text | |
717 |
|
717 | |||
718 | $ hg help helpext |
|
718 | $ hg help helpext | |
719 | helpext extension - no help text available |
|
719 | helpext extension - no help text available | |
720 |
|
720 | |||
721 | list of commands: |
|
721 | list of commands: | |
722 |
|
722 | |||
723 | nohelp (no help text available) |
|
723 | nohelp (no help text available) | |
724 |
|
724 | |||
725 | use "hg -v help helpext" to show aliases and global options |
|
725 | use "hg -v help helpext" to show aliases and global options | |
726 |
|
726 | |||
727 | Test a help topic |
|
727 | Test a help topic | |
728 |
|
728 | |||
729 | $ hg help revs |
|
729 | $ hg help revs | |
730 | Specifying Single Revisions |
|
730 | Specifying Single Revisions | |
731 |
|
731 | |||
732 | Mercurial supports several ways to specify individual revisions. |
|
732 | Mercurial supports several ways to specify individual revisions. | |
733 |
|
733 | |||
734 | A plain integer is treated as a revision number. Negative integers are |
|
734 | A plain integer is treated as a revision number. Negative integers are | |
735 | treated as sequential offsets from the tip, with -1 denoting the tip, -2 |
|
735 | treated as sequential offsets from the tip, with -1 denoting the tip, -2 | |
736 | denoting the revision prior to the tip, and so forth. |
|
736 | denoting the revision prior to the tip, and so forth. | |
737 |
|
737 | |||
738 | A 40-digit hexadecimal string is treated as a unique revision identifier. |
|
738 | A 40-digit hexadecimal string is treated as a unique revision identifier. | |
739 |
|
739 | |||
740 | A hexadecimal string less than 40 characters long is treated as a unique |
|
740 | A hexadecimal string less than 40 characters long is treated as a unique | |
741 | revision identifier and is referred to as a short-form identifier. A |
|
741 | revision identifier and is referred to as a short-form identifier. A | |
742 | short-form identifier is only valid if it is the prefix of exactly one |
|
742 | short-form identifier is only valid if it is the prefix of exactly one | |
743 | full-length identifier. |
|
743 | full-length identifier. | |
744 |
|
744 | |||
745 | Any other string is treated as a tag or branch name. A tag name is a |
|
745 | Any other string is treated as a tag or branch name. A tag name is a | |
746 | symbolic name associated with a revision identifier. A branch name denotes |
|
746 | symbolic name associated with a revision identifier. A branch name denotes | |
747 | the tipmost revision of that branch. Tag and branch names must not contain |
|
747 | the tipmost revision of that branch. Tag and branch names must not contain | |
748 | the ":" character. |
|
748 | the ":" character. | |
749 |
|
749 | |||
750 | The reserved name "tip" is a special tag that always identifies the most |
|
750 | The reserved name "tip" is a special tag that always identifies the most | |
751 | recent revision. |
|
751 | recent revision. | |
752 |
|
752 | |||
753 | The reserved name "null" indicates the null revision. This is the revision |
|
753 | The reserved name "null" indicates the null revision. This is the revision | |
754 | of an empty repository, and the parent of revision 0. |
|
754 | of an empty repository, and the parent of revision 0. | |
755 |
|
755 | |||
756 | The reserved name "." indicates the working directory parent. If no |
|
756 | The reserved name "." indicates the working directory parent. If no | |
757 | working directory is checked out, it is equivalent to null. If an |
|
757 | working directory is checked out, it is equivalent to null. If an | |
758 | uncommitted merge is in progress, "." is the revision of the first parent. |
|
758 | uncommitted merge is in progress, "." is the revision of the first parent. | |
|
759 | ||||
|
760 | Test help hooks | |||
|
761 | ||||
|
762 | $ cat > helphook1.py <<EOF | |||
|
763 | > from mercurial import help | |||
|
764 | > | |||
|
765 | > def rewrite(topic, doc): | |||
|
766 | > return doc + '\nhelphook1\n' | |||
|
767 | > | |||
|
768 | > def extsetup(ui): | |||
|
769 | > help.addtopichook('revsets', rewrite) | |||
|
770 | > EOF | |||
|
771 | $ cat > helphook2.py <<EOF | |||
|
772 | > from mercurial import help | |||
|
773 | > | |||
|
774 | > def rewrite(topic, doc): | |||
|
775 | > return doc + '\nhelphook2\n' | |||
|
776 | > | |||
|
777 | > def extsetup(ui): | |||
|
778 | > help.addtopichook('revsets', rewrite) | |||
|
779 | > EOF | |||
|
780 | $ echo '[extensions]' >> $HGRCPATH | |||
|
781 | $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH | |||
|
782 | $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH | |||
|
783 | $ hg help revsets | grep helphook | |||
|
784 | helphook1 | |||
|
785 | helphook2 |
General Comments 0
You need to be logged in to leave comments.
Login now