Commits

Steve Losh committed 78819a1

api: wrap the exists mkdir call to avoid needless errors

Comments (0)

Files changed (1)

 
     def _create_exists_entry(self):
         path = os.path.join(self.repo.root, self.node)
-        os.mkdir(path)
-        with open(os.path.join(path, '.exists'), 'w') as e:
+
+        if os.path.exists(path):
+            return
+
+        if not os.path.exists(path):
+            os.mkdir(path)
+
+        with open(os.path.join(path, '.exists'), 'w'):
             pass
 
         cmdutil.commit(self.ui, self.repo, _commitfunc,