Dies ist eine alte Version des Dokuments!
hg
lists basic commands, hg help
lists all commands and hg help <command>
shows the help for <command>
(As an alternative if the package of the distro is outdated)
removepkg mercurial…
)make
to get helpmake install
/etc/profile.d/mercurial.sh
with this content: export PYTHONPATH="$PYTHONPATH:/usr/local/lib/python2.5/site-package"
Step 4 installs the following content to usr/local/
:
lib/python2.5/site-packages/* bin/hg share/man/man1/hg.1 share/man/man5/hgrc.5 share/man/man5/hgignore.5
Configuration of mercurial is done in $HOME/.hgrc
. See http://www.selenic.com/mercurial/hgrc.5.html
; ~/.hgrc [extensions] hgext.graphlog = hgext.extdiff = [extdiff] cmd.kdiff = kompare [paths] someShortcut = ssh://someUrl/somePath/someProject
Sources: TipsAndTricks Extdiff extension HGBook
Download and install colordiff from www.slackbuilds.org. Then add the following to $HOME/.hgrc
:
[extensions] hgext.extdiff = [extdiff] cmd.cdiff = colordiff opts.cdiff = -uprN
Usage: hg cdiff [...] [| less -R]
Add the following to $HOME/.hgrc
:
[extensions] hgext.extdiff = [extdiff] cmd.kdiff = kompare
Edit ~/.hgrc
(More):
[ui] username = New Username <new@address>
Bookmarks for often accessed remote repositories can be set in .hgrc
. Example:
alias
Just edit .hg/hgrc
in your local repo. More
Cd into the root directory of your project and type hg init
. This merely creates the subdir .hg
which is the repository. The current dir becomes the working dir of the project.
Add all files to the project by hg add
and hg commit
This is a no-brainer See ConvertExtension. Note that the conversion worked witout the
cvsps
tool mentioned there (On Slack 12.2 with Mercurial 1.4.1)
hg convert <pathToCheckedOutCvsModule>
See hg clone
(Note that there exists also a possibility for internal branches and merges.)
Pulling from another repository usually creates a 2nd head (= 2nd branch) in your repo.
This section describes how to create e.g. client-specific variants of the same main project eg. for special needs of customers.
See also Handling Variants for the solution in SVN.
Verify
Exclude client-specific code from the repo:
.hgignore
.Sub-repo can always pull from the sub-repo of the trunk. Everything in the main repo can pushed and pulled in every direction.
All variants are part of the whole project:
.hgignore
.
Advantages: Every variant is accessible in every repo. Everything can pushed and pulled in every direction.
Disadvantage: Symlink must be created or a fallback mechanism to a default-variant must be implemented.
Suitable for projects which are not under your control, i.e. where you just use the code and don't contribute back.
hg revert <file1> [<file2>]
Restores the files in the working directory to the state when they had been last commited. Much more options are posssible, see hg help revert
Hgbook Wiki
Do hg rollback
(and afterwards hg revert
)
Use clone -r <revnumber> <old> <new>
to create a repo which contains only the changesets until <revnumber>. Than throw away the original repo and use the cloned repo.