2010年12月20日星期一

[Mercurial] Graphical view of a repository, simple view of a Changeset of a File

With the style template mentioned in previous post: [Mercurial] Enhance hg log with nice coloring, you can view your repository, changeset and history of a file in a colorful way in a ANSI console.
Today I will introduce 4 alias commands: hggl, hgch, hgcs and hgsl.

1. [hggl] Graphical view of a repository

To see latest N changeset of your repository, you can type "hggl N"


2. [hgch] View the detail of latest commit

After you commit a file, it will become a head, the latest head call tip. To view the detail of tip, type "hgch"


3. [hgcs] View detail of a Tag or Changeset

If you want to view the detail of a tag or a changeset, you can type "hgcs" followed by a ChangesetID or a Tag name.


4. [hgsl] View the history summary of a file

If you want to see the latest N changesets include the change of a particular file, you can type "hgsl N FILE"

To get the above 4 commands works, first, you need to download the style template and put them in "C:\Program Files\TortoiseHg\templates". Then, add the aliases in .hgrc and .bashrc.

Download:

Modify files:
File: .hgrc
[alias]
slog  = log --style slog
sglog = glog --style sglog
cslog = log --style changeset
chlog = log -r tip --style changeset

File: .bashrc
# hggl, hgch, hgcs and hgsl
alias hggl="hg sglog -v -l"
alias hgch="hg chlog"
alias hgcs="hg cslog -r"
alias hgsl="hg slog -l"

沒有留言:

發佈留言