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

  • Home
  • SEARCH
  • 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 69247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T19:32:36+00:00 2026-05-10T19:32:36+00:00

When using mercurial, I’d like to be able to diff the working copy of

  • 0

When using mercurial, I’d like to be able to diff the working copy of a file with the tip file in my default remote repository. Is there an easy way to do this?

I know I can do an ‘hg incoming -p’ to see the patch sets of changes coming in, but it’d be nice to just directly see the actual changes for a particular file that I’d get if I do a pull of the latest stuff (or what I might be about put push out).

The easiest thing I can think of right now is to create a little script that takes a look at the default location in .hg/hgrc and downloads the file using curl (if it’s over http, otherwise scp it over ssh, or just do a direct diff if it’s on the local file system) and then to diff the working copy or the tip against that temporary copy.

I’m trying to sell mercurial to my team, and one of my team members brought this up today as something that they’re able to do easily in SVN with their GUI tools.

  • 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. 2026-05-10T19:32:37+00:00Added an answer on May 10, 2026 at 7:32 pm

    After some digging, I came across the Rdiff extension that does most of what I want it to.

    It doesn’t come with mercurial, but it can be installed by cloning the repository:

    hg clone http://hg.kublai.com/mercurial/extensions/rdiff  

    And then modifing your ~/.hgrc file to load the extension:

    [extensions]  rdiff=~/path/to/rdiff/repo/rdiff.py 

    It’s a little quirky in that it actually modifies the existing ‘hg diff’ command by detecting if the first parameter is a remote URL. If it is then it will diff that file against your tip file in your local repo (not the working copy). This as the remote repo is first in the arguments, it’s the reverse of what I’d expect, but you can pass ‘–reverse’ to the hg diff command to switch that around.

    I could see these being potential enhancements to the extension, but for now, I can work around them with a bash/zsh shell function in my starup file. It does a temp checkin of my working copy (held by the mercurial transaction so it can be rolled back), executes the reverse diff, and then rolls the transaction back to return things back to the way they were:

    hgrdiff() {     hg commit -m 'temp commit for remote diff' &&      hg diff --reverse http://my_hardcoded_repo $* &&     hg rollback      # revert the temporary commit } 

    And then call it with:

    hgrdiff <filename to diff against remote repo tip> 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Git or Mercurial, if the working directory is 1GB, then the local repository
I'm using Mercurial on Win32 (Server 03). I'd like to copy a Subversion repo
Using Mercurial, TortoiseHG, Win XP. I had a working directory with a number of
Using Mercurial, we can commit one file by using hg commit file.rb or 1
When using Mercurial, how do you undo all changes in the working directory since
I am using mercurial as part of my workflow process and it is working
I'm (ab)using Mercurial to manage thousands of files that change often, but I'd like
I am using Mercurial to develop a client project. After I've been working on
When using Mercurial I sometimes find that it is hard to understand the relationship
We're using Mercurial where I work and I want to have a setup similar

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.