|
1 MERCURIAL QUICK-START |
|
2 |
1 Setting up Mercurial: |
3 Setting up Mercurial: |
2 |
4 |
3 Note: some distributions fails to include bits of distutils by |
5 Note: some distributions fails to include bits of distutils by |
4 default, you'll need python-dev to install. You'll also need a C |
6 default, you'll need python-dev to install. You'll also need a C |
5 compiler and a 3-way merge tool like merge, tkdiff, or kdiff3. |
7 compiler and a 3-way merge tool like merge, tkdiff, or kdiff3. |
26 If you get complaints about missing modules, you probably haven't set |
28 If you get complaints about missing modules, you probably haven't set |
27 PYTHONPATH correctly. |
29 PYTHONPATH correctly. |
28 |
30 |
29 Setting up a Mercurial project: |
31 Setting up a Mercurial project: |
30 |
32 |
31 $ cd linux/ |
33 $ cd project/ |
32 $ hg init # creates .hg |
34 $ hg init # creates .hg |
33 $ hg status # show changes between repo and working dir |
35 $ hg status # show changes between repo and working dir |
34 $ hg diff # generate a unidiff |
36 $ hg diff # generate a unidiff |
35 $ hg addremove # add all unknown files and remove all missing files |
37 $ hg addremove # add all unknown files and remove all missing files |
36 $ hg commit # commit all changes, edit changelog entry |
38 $ hg commit # commit all changes, edit changelog entry |
40 repository contains a set of regular expressions to ignore in file |
42 repository contains a set of regular expressions to ignore in file |
41 paths. |
43 paths. |
42 |
44 |
43 Mercurial commands: |
45 Mercurial commands: |
44 |
46 |
|
47 $ hg help [command] # get online help |
45 $ hg history # show changesets |
48 $ hg history # show changesets |
46 $ hg log Makefile # show commits per file |
49 $ hg log Makefile # show commits per file |
47 $ hg update # check out the tip revision |
50 $ hg update # check out the tip revision |
48 $ hg update <id> # check out a specified changeset |
51 $ hg update <id> # check out a specified changeset |
49 # IDs can be tags, revision numbers, or unique |
52 # IDs can be tags, revision numbers, or unique |
90 28237:747a537bd090880c29eae861df4d81b245aa0190 |
93 28237:747a537bd090880c29eae861df4d81b245aa0190 |
91 $ hg export 28237 > foo.patch # export changeset 28237 |
94 $ hg export 28237 > foo.patch # export changeset 28237 |
92 |
95 |
93 Network support: |
96 Network support: |
94 |
97 |
95 # pull the self-hosting hg repo |
98 # pull from the primary Mercurial repo |
96 foo$ hg init |
99 foo$ hg init |
97 foo$ hg pull http://selenic.com/hg/ |
100 foo$ hg pull http://selenic.com/hg/ |
98 foo$ hg update # hg co works too |
101 foo$ hg update # hg co works too |
99 |
102 |
100 # export your current repo via HTTP with browsable interface |
103 # export your current repo via HTTP with browsable interface |
103 # pushing changes to a remote repo with SSH |
106 # pushing changes to a remote repo with SSH |
104 foo$ hg push ssh://user@example.com/~/hg/ |
107 foo$ hg push ssh://user@example.com/~/hg/ |
105 |
108 |
106 # merge changes from a remote machine |
109 # merge changes from a remote machine |
107 bar$ hg pull http://foo/ |
110 bar$ hg pull http://foo/ |
108 bar$ hg co # merge changes into your working directory |
111 bar$ hg update -m # merge changes into your working directory |
109 |
112 |
110 # Set up a CGI server on your webserver |
113 # Set up a CGI server on your webserver |
111 foo$ cp hgweb.cgi ~/public_html/hg-linux/index.cgi |
114 foo$ cp hgweb.cgi ~/public_html/hg/index.cgi |
112 foo$ emacs ~/public_html/hg-linux/index.cgi # adjust the defaults |
115 foo$ emacs ~/public_html/hg/index.cgi # adjust the defaults |
113 |
116 |
114 Symbolic repository names: |
117 Symbolic repository names: |
115 |
118 |
116 Mercurial uses an options file called ~/.hgrc. To track locations |
119 Mercurial uses an options file called ~/.hgrc. To track locations |
117 symbolically, add a section to it like this: |
120 symbolically, add a section to it like this: |
118 |
121 |
119 [paths] |
122 [paths] |
120 main = http://selenic.com/hg |
123 main = http://selenic.com/hg |
121 hgweb = http://edge2.net/hg/hgweb/ |
124 linux = http://www.kernel.org/hg/ |
122 hgdoc = http://edge2.net/hg/man/ |
|