Mercurial

有沒有辦法在 mercurial 中模擬 git show?

  • October 4, 2016

我經常使用 $ git show commitid 來查看一個人做了哪些更改。例如 -

┌─[shirish@debian] - [~/games/libcpuid] - [10029]
└─[$] git show b5bd535

commit b5bd5355829dcd123fba20a3c1d14f2bc139dc43
Author: eloaders <eloaders@linux.pl>
Date:   Mon Oct 3 20:10:02 2016 +0200

Fix #72

let libcpuid 0.4.0 and brethen conflict with libcpuid 0.3.0 and its
brethen

diff --git a/debian/control b/debian/control
index ba71f44..b70c5da 100644
--- a/debian/control
+++ b/debian/control
@@ -9,7 +9,7 @@ Homepage: https://github.com/anrieff/libcpuid
Package: libcpuid14
Architecture: amd64 i386
Depends: ${shlibs:Depends}, ${misc:Depends}, ${misc:Pre-Depends}
-Replaces: libcpuid11

+Replaces: libcpuid11, libcpuid13
Description: small C library for x86/x86_64 CPU detection and feature extraction

這是來自https://github.com/anrieff/libcpuid但這不是真正的問題。有沒有類似的方法來使用具有彩色差異的 mercurial 和所有?我嘗試了 $hg show changeset id 但無處可去:(

啟用顏色擴展

使用類似的東西hg log -r NNN -v -p -g(不能顯示彩色塊,但它們這裡)

changeset:   7:32bbc6bc3867
user:        AL <lazybadger@*>
date:        Tue Nov 20 03:51:53 2012 +0600
files:       404.php
description:
Localization of page


diff --git a/404.php b/404.php
--- a/404.php
+++ b/404.php
@@ -1,8 +1,8 @@
<?php get_header(); ?>

  <article class="noposts">
-       <h2>404 - Content Not Found</h2>
-       <p>We don't seem to be able to find the content you have requested - why not try a search below?</p>
+       <h2><?php _e('404 - Content Not Found','fiver' ); ?></h2>
+       <p><?php _e('We don’t seem to be able to find the content you have requested - why not try a search below?','fiver' ); ?></p>
       <?php get_search_form(); ?>
  </article>

如果您想更改預設輸出 - 只需編寫自己的樣式並添加-T stylename到日誌選項

筆記

使用的選項:

  • -r定義要顯示的變更集的範圍(可以是單個變更集或修訂集)
  • -v(可選)詳細輸出:稍微更改預設輸出的格式並添加帶有文件的字元串,在每個變更集中都受到影響(預設沒有類似物git show
  • -p將更改的差異附加到日誌輸出
  • -g以“擴展 Git 格式”發出上述差異(因為git showdiff 始終採用 Git 格式)

引用自:https://unix.stackexchange.com/questions/314098