--- a/hgext/convert/monotone.py Sun May 17 03:14:37 2009 +0200
+++ b/hgext/convert/monotone.py Sun May 17 03:19:00 2009 +0200
@@ -93,19 +93,11 @@
def mtnisfile(self, name, rev):
# a non-file could be a directory or a deleted or renamed file
self.mtnloadmanifest(rev)
- try:
- self.files[name]
- return True
- except KeyError:
- return False
+ return name in self.files
def mtnisdir(self, name, rev):
self.mtnloadmanifest(rev)
- try:
- self.dirs[name]
- return True
- except KeyError:
- return False
+ return name in self.dirs
def mtngetcerts(self, rev):
certs = {"author":"<missing>", "date":"<missing>",
@@ -190,11 +182,8 @@
def getmode(self, name, rev):
self.mtnloadmanifest(rev)
- try:
- node, attr = self.files[name]
- return attr
- except KeyError:
- return ""
+ node, attr = self.files.get(name, (None, ""))
+ return attr
def getfile(self, name, rev):
if not self.mtnisfile(name, rev):