def is_valid_sandbox(self, dir): if isdir(dir): dirstack = DirStack() dirstack.push(dir) try: rc, lines = self.process.popen( 'git rev-parse --is-inside-work-tree', echo=False, echo2=False) if rc == 0 and lines: return lines[0] == 'true' finally: dirstack.pop() return False
def is_valid_sandbox(self, dir): if isdir(dir): dirstack = DirStack() dirstack.push(dir) try: rc, lines = self.process.popen( 'hg status', echo=False, echo2=False) if rc == 0: return True finally: dirstack.pop() return False