0

I have been using the mercurial and Beyond Compare 4 tools together for about 2 weeks now and feel fairly confident in my usage, however I still seem to have a problem when comparing incoming changesets against my current local codebase. The problem is emphasized when I attempting a complicated merge.

Just to clarify, I am avoiding the use of tools such as TortoiseHg, although I do have it installed. I am searching for feedback via cmd line operations only.

My current templated method to pull down the incoming changesets via the following ( as an [alias] )

hg in --verbose -T "\nchangeset: \t{rev}\nbranch: \t{branch}\nuser: \t\t{author}\ndate: \t\t{date(date,'%m-%d-%Y %I:%M%p')}\ndescription: \n\t{desc|fill76|tabindent}\n\n{files % ' \t{file}\n'}\n----------\n"

As an example, here is a simplified (and cleverly abstracted) block returned ::

changeset:      4685
branch:         Feature-WI209825
user:           Jack Handy <jhandy@anon.com>
date:           01-19-2015 10:19AM
description:
        Display monkey swinging from vines while whistling dixie

        Zoo/MonkeyCage/Resources/Localization.Designer.cs
        Zoo/MonkeyCage/Resources/Localization.resx
        Zoo/MonkeyCage/Utility/Extensions.cs

If I were to be comparing changes locally, I would simply use the following command ::

hg bcomp -r 4685 -r default <optional file name>

and then I would get an instance of Beyond Compare with a folder structure and files and I could just navigate accordingly to view the changes...however, when I attempt to do this with a changeset that has yet to be pulled into my local repository, I can't.

How do I diff incoming changesets with my local repository?

---- UPDATE --------------------------------

I pursued the idea of bundling the incoming changes and then trying to use BC4 to diff the bundle to any given branch/revision on my local repo.

hg in --bundle "C:\Sandboxes\Temp\temp.hg"

This creates a compressed file archive containing all the new changes.

Now I simply need to diff this bundle with my local, however am having difficulty optimizing this. Currently, I am using variations on the following command:

hg -R "C:\Sandboxes\Temp\temp.hg" bcomp -r default

Alas, I am still having difficulty perfecting this...any insight is appreciated.

beauXjames
  • 8,222
  • 3
  • 49
  • 66

2 Answers2

0

I don't see how you can, since your local repository doesn't yet have that changeset, so mercurial can't create a local copy of the revision, as it doesn't have visibility of what the change actually is.

The -p flag to hg incoming will show you the patch for each revision, but that isn't what you want.

Why not just pull the remote changes anyway? It wont hurt unless you actually update. You can then do your diff in the normal way.

mjs
  • 2,837
  • 4
  • 28
  • 48
  • True, however with tools such as Tortoise Hg Workbench, you're able to diff the incoming packages before an official pull, which is my happy path when I have the choice. I did look into the ability to create a bundle and then diff the bundle against the local repository...which opens up many options. – beauXjames Jan 21 '15 at 14:21
-1

hg diff is a local operation. But you can simply call hg incoming -p in order to obtain a diff view of what you're going to pull. See hg help incoming for more options and refinement (e.g. if you need to diff against a specific rev etc)

planetmaker
  • 5,884
  • 3
  • 28
  • 37
  • 1
    did you not read the question? the first example I show is using hg (in)coming – beauXjames Jan 20 '15 at 15:18
  • You were asking for a diff with your local repo. The flag "-p" used on incoming provides you with that... and you did not imply that you were aware of it. – planetmaker Jan 21 '15 at 09:40
  • did you even both to run the line I presented? you'd find it's much more informative than -p offers...which is a convoluted mash of monkey poo in a cmd window...the question is how to take this info and put it somewhere useful...which is why I also refer to Beyond Compare... – beauXjames Jan 21 '15 at 14:24