[PATCH] Make extdiff work at root directory

Alexis S. L. Carvalho alexis at cecm.usp.br
Thu Feb 15 02:03:15 CST 2007


Thus spake Andrei Vermel:
> Symptom: 
> If repo is at root dir, 'hg vdiff' fails trying to create an existing 
> temporary dir.
> 
> # HG changeset patch
> # User Andrei Vermel <avermel at mail.ru>
> # Date 1171458420 -10800
> # Node ID 95337102a85c84d408ecae063c0a3662cc2973c1
> # Parent  c4d9407fa016c5f0ae26e5ea5f58d89012694d05
> Make extdiff work at root directory
> 
> diff -r c4d9407fa016 -r 95337102a85c hgext/extdiff.py
> --- a/hgext/extdiff.py  Wed Feb 14 16:07:00 2007 +0300
> +++ b/hgext/extdiff.py  Wed Feb 14 16:07:00 2007 +0300
> @@ -82,6 +82,8 @@ def dodiff(ui, repo, diffcmd, diffopts, 
>         if not using snapshot, -I/-X does not work and recursive diff
>         in tools like kdiff3 and meld displays too many files.'''
>         dirname = os.path.basename(repo.root)
> +        if dirname == "":
> +            dirname = "wdir"

Can you send a similar patch that also changes the snapshot_node
function in the same way and uses the same name (say, "root") in both?

This should look a bit better than the ".0123456789ab" directory that
snapshot_node gives us in this case and should be a bit more consistent
with the usual case.

Alexis


More information about the Mercurial-devel mailing list