Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7842713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:23:07+00:00 2026-06-02T16:23:07+00:00

After moving a file into another directory I cannot display the differences between two

  • 0

After moving a file into another directory I cannot display the differences between two revisions any more. E.g.:

hg init

touch a
hg add a
hg ci -m "Added a"

echo "Bli" >> a
hg ci -m "Bli"
echo "Bla" >> a
hg ci -m "Bla"
echo "Blub" >> a
hg ci -m "Blub"

hg diff -r 0 -r 1 a

Results in:

diff -r 8603b08f5a64 -r 16675581549e a
--- a/a Mon Apr 23 09:03:25 2012 +0000
+++ b/a Mon Apr 23 09:03:25 2012 +0000
@@ -0,0 +1,1 @@
+Bli

which is what I expected. However when I now move the file “a” into a directory “b”:

mkdir b
hg mv a b/a
hg ci -m "Moved a into b"
cd b
hg diff -r 0 -r 1 a

this results into nothing (no output at all). I also tried to use the git Giff algo:

hg diff --git -r 0 -r 1 a

Again, there is no output at all. The log is seems to be OK:

hg log --follow a

Results in:

changeset:   4:cb8185829bfd
tag:         tip
user:        XXXXXXXXXXXXXXXXXXXXXXXXXXXX
date:        Mon Apr 23 09:08:12 2012 +0000
summary:     Moved a into b

changeset:   3:4d1ba89885c3
user:        XXXXXXXXXXXXXXXXXXXXXXXXXXXX
date:        Mon Apr 23 09:03:26 2012 +0000
summary:     Blub

changeset:   2:e9126dbb50b2
user:        XXXXXXXXXXXXXXXXXXXXXXXXXXXX
date:        Mon Apr 23 09:03:26 2012 +0000
summary:     Bla

changeset:   1:16675581549e
user:        XXXXXXXXXXXXXXXXXXXXXXXXXXXX
date:        Mon Apr 23 09:03:25 2012 +0000
summary:     Bli

changeset:   0:8603b08f5a64
user:        XXXXXXXXXXXXXXXXXXXXXXXXXXXX
date:        Mon Apr 23 09:03:25 2012 +0000
summary:     Added a

Has someone any idea why the diff is not working after moving a file? Your help is greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T16:23:08+00:00Added an answer on June 2, 2026 at 4:23 pm

    This is difficult or impossible with today’s Mercurial. I think the closest you can get is

    hg log --follow --patch -r 1 a
    

    where Mercurial will track the copies backwards (--follow) before showing the diff (--patch).

    In general, Mercurial does not track file identities, it only tracks file names. When you lookup information by revision number, Mercurial will first lookup the revision, and then lookup any filenames in that revision. So hg cat -r 0 a will give you the same result as

    hg update -r 0
    cat a
    

    i.e., the result is independent of the current working directory parent.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After moving my database and web site for another server I got the error
After moving to the new server, I'm getting plenty of such notifications: A PHP
I want to access RegEx results after I am done moving files with this
After some experience with functional languages, I'm starting to use recursion more in Java
After loosing much sleep I still cannot figure this out: The code below (its
I'm trying to molularize my ASP.NET MVC application by moving each Area into their
It seems a bunch of my Rspec tests now fail after moving my application
It seems a bunch of my Rspec tests now fail after moving my application
We have a WSP package for deploying an application into MOSS 2007. After deploying
I'm having an issue after moving to a new server where my WordPress htaccess

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.