32 $ hg init # creates .hg |
32 $ hg init # creates .hg |
33 $ hg status # show changes between repo and working dir |
33 $ hg status # show changes between repo and working dir |
34 $ hg diff # generate a unidiff |
34 $ hg diff # generate a unidiff |
35 $ hg addremove # add all unknown files and remove all missing files |
35 $ hg addremove # add all unknown files and remove all missing files |
36 $ hg commit # commit all changes, edit changelog entry |
36 $ hg commit # commit all changes, edit changelog entry |
37 $ hg export # export a changeset as a diff |
37 $ hg export <rev> # export a changeset as a diff |
38 |
38 |
39 Mercurial will look for a file named .hgignore in the root of your |
39 Mercurial will look for a file named .hgignore in the root of your |
40 repository contains a set of regular expressions to ignore in file |
40 repository contains a set of regular expressions to ignore in file |
41 paths. |
41 paths. |
42 |
42 |
43 Mercurial commands: |
43 Mercurial commands: |
44 |
44 |
45 $ hg history # show changesets |
45 $ hg history # show changesets |
46 $ hg log Makefile # show commits per file |
46 $ hg log Makefile # show commits per file |
47 $ hg checkout # check out the tip revision |
47 $ hg update # check out the tip revision |
48 $ hg checkout <id> # check out a specified changeset |
48 $ hg update <id> # check out a specified changeset |
49 # IDs can be tags, revision numbers, or unique |
49 # IDs can be tags, revision numbers, or unique |
50 # subsets of changeset hash numbers |
50 # subsets of changeset hash numbers |
51 $ hg add foo # add a new file for the next commit |
51 $ hg add foo # add a new file for the next commit |
52 $ hg remove bar # mark a file as removed |
52 $ hg remove bar # mark a file as removed |
53 $ hg verify # check repo integrity |
53 $ hg verify # check repo integrity |
58 |
58 |
59 $ cd .. |
59 $ cd .. |
60 $ mkdir linux-work |
60 $ mkdir linux-work |
61 $ cd linux-work |
61 $ cd linux-work |
62 $ hg branch ../linux # create a new branch |
62 $ hg branch ../linux # create a new branch |
63 $ hg checkout # populate the working directory |
63 $ hg update # populate the working directory |
64 $ <make changes> |
64 $ <make changes> |
65 $ hg commit |
65 $ hg commit |
66 $ cd ../linux |
66 $ cd ../linux |
67 $ hg merge ../linux-work # pull changesets from linux-work |
67 $ hg pull ../linux-work # pull changesets from linux-work |
|
68 $ hg update # merge the new tip from linux-work into |
|
69 # our working directory |
68 |
70 |
69 Importing patches: |
71 Importing patches: |
70 |
72 |
71 Fast: |
73 Fast: |
72 $ patch < ../p/foo.patch |
74 $ patch < ../p/foo.patch |
90 |
92 |
91 Network support: |
93 Network support: |
92 |
94 |
93 # pull the self-hosting hg repo |
95 # pull the self-hosting hg repo |
94 foo$ hg init |
96 foo$ hg init |
95 foo$ hg merge http://selenic.com/hg/ |
97 foo$ hg pull http://selenic.com/hg/ |
96 foo$ hg checkout # hg co works too |
98 foo$ hg update # hg co works too |
97 |
99 |
98 # export your current repo via HTTP with browsable interface |
100 # export your current repo via HTTP with browsable interface |
99 foo$ hg serve -n "My repo" -p 80 |
101 foo$ hg serve -n "My repo" -p 80 |
100 |
102 |
101 # merge changes from a remote machine |
103 # merge changes from a remote machine |
102 bar$ hg merge http://foo/ |
104 bar$ hg pull http://foo/ |
103 bar$ hg co # checkout the result |
105 bar$ hg co # merge changes into your working directory |
104 |
106 |
105 # Set up a CGI server on your webserver |
107 # Set up a CGI server on your webserver |
106 foo$ cp hgweb.cgi ~/public_html/hg-linux/index.cgi |
108 foo$ cp hgweb.cgi ~/public_html/hg-linux/index.cgi |
107 foo$ emacs ~/public_html/hg-linux/index.cgi # adjust the defaults |
109 foo$ emacs ~/public_html/hg-linux/index.cgi # adjust the defaults |
108 |
110 |