[PATCH] Handle when the slicemap option is an empty string

stefan at rusek.org stefan at rusek.org
Wed Feb 11 15:20:16 CST 2009


# HG changeset patch
# User Stefan Rusek <stefan at rusek.org>
# Date 1234385277 -3600
# Node ID 896047d6c97f29313e2bc78477a6d64ffd176b57
# Parent  998fc8f62539ee26601d526803d6da2476129411
Handle when the slicemap option is an empty string

In the cmdtable for the convert extension, the default value for splicefile is
empty string, while mapfile (the class that reads splicemaps) expects either a
real path or None. This patch changes mapfile to expect a real path or logical
false (False, None, empty string, etc.)

diff --git a/hgext/convert/common.py b/hgext/convert/common.py
--- a/hgext/convert/common.py
+++ b/hgext/convert/common.py
@@ -325,7 +325,7 @@
         self._read()
 
     def _read(self):
-        if self.path is None:
+        if not self.path:
             return
         try:
             fp = open(self.path, 'r')


More information about the Mercurial-devel mailing list