changeset 4088:18dcc22666a0

Make extdiff work at root directory
author Andrei Vermel <avermel@mail.ru>
date Thu, 15 Feb 2007 12:51:43 +0300
parents 587c6c652f82
children 0ff50cc7acb4
files hgext/extdiff.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/extdiff.py	Thu Feb 15 05:38:00 2007 -0200
+++ b/hgext/extdiff.py	Thu Feb 15 12:51:43 2007 +0300
@@ -58,7 +58,10 @@
         '''snapshot files as of some revision'''
         changes = repo.changelog.read(node)
         mf = repo.manifest.read(changes[0])
-        dirname = '%s.%s' % (os.path.basename(repo.root), short(node))
+        dirname = os.path.basename(repo.root)
+        if dirname == "":
+            dirname = "root"
+        dirname = '%s.%s' % (dirname, short(node))
         base = os.path.join(tmproot, dirname)
         os.mkdir(base)
         if not ui.quiet:
@@ -82,6 +85,8 @@
         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 = "root"
         base = os.path.join(tmproot, dirname)
         os.mkdir(base)
         if not ui.quiet: