# HG changeset patch # User Benoit Boissinot # Date 1242523140 -7200 # Node ID f6c99b1628d76899462c6268f617c153dd3a19e0 # Parent e33baed7c1bc41c777907386e4e435ec6c75f7ad convert: cleanups in monotone converter diff -r e33baed7c1bc -r f6c99b1628d7 hgext/convert/monotone.py --- 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":"", "date":"", @@ -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):