README
changeset 63 1c590d34bf61
parent 27 febfb35d2a3e
child 67 a182f2561c8e
equal deleted inserted replaced
62:022d98aa0a2a 63:1c590d34bf61
     4  python-dev to install. Alternately, shove everything somewhere in
     4  python-dev to install. Alternately, shove everything somewhere in
     5  your path.
     5  your path.
     6 
     6 
     7  $ tar xvzf mercurial-<ver>.tar.gz
     7  $ tar xvzf mercurial-<ver>.tar.gz
     8  $ cd mercurial-<ver>
     8  $ cd mercurial-<ver>
     9  $ python setup.py install --home ~
     9  $ python2.3 setup.py install --home ~
    10  $ export PYTHONPATH=${HOME}/lib/python  # add this to your .bashrc
    10  $ export PYTHONPATH=${HOME}/lib/python  # add this to your .bashrc
    11  $ export HGMERGE=tkmerge                # customize this
    11  $ export HGMERGE=tkmerge                # customize this
    12  $ hg                                    # test installation, show help
    12  $ hg                                    # test installation, show help
    13 
    13 
    14  If you get complaints about missing modules, you probably haven't set
    14  If you get complaints about missing modules, you probably haven't set
    15  PYTHONPATH correctly.
    15  PYTHONPATH correctly.
    16 
    16 
    17  You may also want to install psyco, the python specializing compiler.
       
    18  It makes commits more than twice as fast. The relevant Debian package
       
    19  is python-psyco
       
    20 
       
    21 Setting up a Mercurial project:
    17 Setting up a Mercurial project:
    22 
    18 
    23  $ cd linux/
    19  $ cd linux/
    24  $ hg init         # creates .hg
    20  $ hg init         # creates .hg
    25  $ hg status       # show changes between repo and working dir
    21  $ hg status       # show changes between repo and working dir
    26  $ hg diff         # generate a unidiff
    22  $ hg diff         # generate a unidiff
       
    23  $ hg export       # export a changeset as a diff
    27  $ hg addremove    # add all unknown files and remove all missing files
    24  $ hg addremove    # add all unknown files and remove all missing files
    28  $ hg commit       # commit all changes, edit changelog entry
    25  $ hg commit       # commit all changes, edit changelog entry
    29 
    26 
    30  Mercurial will look for a file named .hgignore in the root of your
    27  Mercurial will look for a file named .hgignore in the root of your
    31  repository contains a set of regular expressions to ignore in file
    28  repository contains a set of regular expressions to ignore in file
    65  $ hg commit `lsdiff -p1 ../p/foo.patch`
    62  $ hg commit `lsdiff -p1 ../p/foo.patch`
    66 
    63 
    67  Fastest:
    64  Fastest:
    68  $ cat ../p/patchlist | xargs hg import -p1 -b ../p 
    65  $ cat ../p/patchlist | xargs hg import -p1 -b ../p 
    69 
    66 
    70 Network support (highly experimental):
    67 Network support:
       
    68 
       
    69  The simple way:
    71 
    70 
    72  # pull the self-hosting hg repo
    71  # pull the self-hosting hg repo
    73  foo$ hg init
    72  foo$ hg init
    74  foo$ hg merge http://selenic.com/hg/
    73  foo$ hg merge http://selenic.com/hg/
    75  foo$ hg checkout  # hg co works too
    74  foo$ hg checkout  # hg co works too
    78  foo$ ln -s .hg ~/public_html/hg-linux 
    77  foo$ ln -s .hg ~/public_html/hg-linux 
    79 
    78 
    80  # merge changes from a remote machine
    79  # merge changes from a remote machine
    81  bar$ hg merge http://foo/~user/hg-linux
    80  bar$ hg merge http://foo/~user/hg-linux
    82 
    81 
    83  This is just a proof of concept of grabbing byte ranges, and is not
    82  The new, fast, experimental way:
    84  expected to perform well. Fixing this needs some pipelining to reduce
    83 
    85  the number of round trips. See zsync for a similar approach.
    84  # pull the self-hosting hg repo
       
    85  foo$ hg init
       
    86  foo$ hg merge hg://selenic.com/hg/
       
    87  foo$ hg checkout  # hg co works too
       
    88 
       
    89  # Set up the CGI server on your webserver
       
    90  foo$ ln -s .hg ~/public_html/hg-linux/.hg
       
    91  foo$ cp hgweb.py ~/public_html/hg-linux/index.cgi
       
    92 
       
    93  # merge changes from a remote machine
       
    94  bar$ hg merge hg://foo/~user/hg-linux
       
    95 
    86 
    96 
    87  Another approach which does perform well right now is to use rsync.
    97  Another approach which does perform well right now is to use rsync.
    88  Simply rsync the remote repo to a read-only local copy and then do a
    98  Simply rsync the remote repo to a read-only local copy and then do a
    89  local pull.
    99  local pull.
    90 
   100