Check If a Merge Modified Any Files

Jensen, Aaron ajensen at webmd.net
Thu Aug 16 00:30:14 UTC 2012


Is there a way to check if a committed merge actually modified any files?  For example, if I modify file1, and another users modify file2, when I merge his head into mine, Mercurial will modify file2 in my working directory, but in file history, Mercurial knows the merge didn't actually modify file2 (an `hg log file2` shows the other developer's changes, but not the merge). (See [1] for a transcript showing what I'm talking about.)

When I view merges in Mercurial, it will show a merge as "empty", i.e. no differences, if that merge didn't actually introduce any new modifications into the repository.  Is there an equivalent Mercurial command that will tell me a merge didn't actually introduce new changes?

     <:> Aaron


[1]
> hg init MergeMods
> cd .\MergeMods
> '' > file1.txt
> '' > file2.txt
> hg add file*
> hg commit -m "Adding files."
> 'a' > .\file1.txt
> hg commit -m "Modifying file1."
> hg up 0
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
> 'b' > .\file2.txt
> hg commit -m "Modifying file2."
created new head
> hg merge
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
> hg commit -m "Merge"
> hg log .\file1.txt --template '{rev}: {desc}\n'
1: Modifying file1.
0: Adding files.
> hg log .\file2.txt --template '{rev}: {desc}\n'
2: Modifying file2.
0: Adding files.
> hg export tip
# HG changeset patch
# User
# Date 1345076516 25200
# Node ID 55cba57217205f4e1262c571a24dea74efd89755
# Parent  3022501938e163f610022dd88d3aa8deb998be09
# Parent  d1138273458c7ac6322ba307cc49b1584a967502
Merge

diff --git a/file1.txt b/file1.txt
--- a/file1.txt
+++ b/file1.txt
@@ -1,1 +1,1 @@
-
+a
> hg log --debug -r tip
changeset:   3:55cba57217205f4e1262c571a24dea74efd89755
tag:         tip
phase:       draft
parent:      2:3022501938e163f610022dd88d3aa8deb998be09
parent:      1:d1138273458c7ac6322ba307cc49b1584a967502
manifest:    3:1bb981da07bccb6cd01e3d7bde26ab7265a7e63c
user:
date:        Wed Aug 15 17:21:56 2012 -0700
files:       file1.txt
extra:       branch=default
description:
Merge

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20120815/217780ea/attachment-0002.html>


More information about the Mercurial mailing list