有沒有辦法在 Mercurial 模擬 git show ?

有沒有辦法在 Mercurial 模擬 git show ?

我經常使用 $ git show commitid 來查看一個人做了什麼更改。對於例如 -

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

commit b5bd5355829dcd123fba20a3c1d14f2bc139dc43
Author: eloaders <[email protected]>
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 但無濟於事:(

答案1

啟用顏色擴充

使用類似的東西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&rsquo;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 格式」發出上述 diff(因為git showdiff 總是採用 Git 格式)

相關內容