Benutzer-Werkzeuge

Webseiten-Werkzeuge


becki:linux:hg_tips

Dies ist eine alte Version des Dokuments!


CVS Tips - Subversion Tips

Mercurial Tips

Getting Help

  • hg lists basic commands, hg help lists all commands and hg help <command> shows the help for <command>
  • Mercurial homepage with docu links

Configuration

Enable graphical log

Add this to the file $HOME/.hgrc:

[extensions]
hgext.graphlog =

Usage: hg glog [OPTIONS]

Source

More user friendly diff

Command Line Diff

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]

Graphical Diff

Add the following to $HOME/.hgrc:

[extensions]
hgext.extdiff =
 
[extdiff]
cmd.kdiff = kompare

Usage

Initial import

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

Source

Single User working Practice

Proposal: Have a central repository per project which is not worked on. For each subproblem to solve clone the central, work on the clone and push the modifications back to the central. More than one subproblem specific repostiories at the same time are possible and encouraged.

hg clone project project-subproblem # clone repository to get new working dir
cd project-subproblem
# make changes
hg commit
hg push ../project

Note, that after the push, the working dir in the central (project) are not modified, the parent (hg parent) is still the old revision. Use hg update in the central to mend this.

Source

Undoing Changes

Undoing lokal Changes

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 resore Hgbook Wiki

Undoing committed Changes

FIXME

Cookies helfen bei der Bereitstellung von Inhalten. Diese Website verwendet Cookies. Mit der Nutzung der Website erklären Sie sich damit einverstanden, dass Cookies auf Ihrem Computer gespeichert werden. Außerdem bestätigen Sie, dass Sie unsere Datenschutzerklärung gelesen und verstanden haben. Wenn Sie nicht einverstanden sind, verlassen Sie die Website. Weitere Information
becki/linux/hg_tips.1260199434.txt.gz · Zuletzt geändert: 2009-12-07 15:23 von becki

Impressum - Datenschutzerklärung