View Mercurial in / out command results in an external diff view

I do a lot of code reviews, mainly using the "hg in -p / path / to / repo" command, and it would be nice if its output could be viewed in some external program (for example, vimdiff). Is there any way to achieve this?

+5
source share
2 answers

My quick and dirty first answer was: "See the Extdiff extension , distributed using the mercury and documented on their website." That was only about 15% of the answer.

The closest answer I've seen so far begins with an extension called rdiff . rdiff uses the "input" code and therefore addresses this half of your question. This extension was mentioned in a previous SO thread, which provides an example bash script for implementing rdiff against the current working copy (as opposed to the current copy of the repository). the script ends up using "hg diff", so it will be affected by everything you have installed extdiff.

rdiff.py is only 146 lines long and fairly straightforward, while a bash script has 5 lines. Although this is not a complete answer to your question, I think it points the way.

+2
source

. , , , :

1) "hg incoming -bundle in.hg", .

2) "hg -R in.hg extdiff",

, , :

pachanga@kurluka $ hg -R /tmp/in.bundle extdiff
** unknown exception encountered, details follow
** report bug details to http://www.selenic.com/mercurial/bts
** or mercurial@selenic.com
** Mercurial Distributed SCM (version 1.1.2)
** Extensions loaded: alias, fetch, extdiff, graphlog, hgk, rdiff
Traceback (most recent call last):
 File "/usr/bin/hg", line 20, in <module>
   mercurial.dispatch.run()
 File "/var/lib/python-support/python2.6/mercurial/dispatch.py", line
20, in run
   sys.exit(dispatch(sys.argv[1:]))
 File "/var/lib/python-support/python2.6/mercurial/dispatch.py", line
29, in dispatch
   return _runcatch(u, args)
 File "/var/lib/python-support/python2.6/mercurial/dispatch.py", line
45, in _runcatch
   return _dispatch(ui, args)
 File "/var/lib/python-support/python2.6/mercurial/dispatch.py", line
367, in _dispatch
   ret = _runcommand(ui, options, cmd, d)
 File "/var/lib/python-support/python2.6/mercurial/dispatch.py", line
416, in _runcommand
   return checkargs()
 File "/var/lib/python-support/python2.6/mercurial/dispatch.py", line
376, in checkargs
   return cmdfunc()
 File "/var/lib/python-support/python2.6/mercurial/dispatch.py", line
361, in <lambda>
   d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
 File "/var/lib/python-support/python2.6/mercurial/util.py", line 715, in check
   return func(*args, **kwargs)
 File "/var/lib/python-support/python2.6/hgext/extdiff.py", line 203,
in extdiff
   return dodiff(ui, repo, program, option, pats, opts)
 File "/var/lib/python-support/python2.6/hgext/extdiff.py", line 123, in dodiff
   node1, node2 = cmdutil.revpair(repo, opts['rev'])
 File "/var/lib/python-support/python2.6/mercurial/cmdutil.py", line
123, in revpair
   return repo.dirstate.parents()[0], None
 File "/var/lib/python-support/python2.6/mercurial/bundlerepo.py",
line 229, in __getattr__
   raise AttributeError(name)
AttributeError: dirstate

, ...

0

All Articles