def __init__(self, repoRoot): super(HgResourceProvider, self).__init__() self.repoRoot = repoRoot print "Mercurial version %s" % hgversion self.ui = mercurial.ui.ui() self.repo = hg.repository(self.ui, repoRoot) self.ui.status("Connected to repository %s\n" % self.repo.root) self.repoRoot = self.repo.root # Some commands (remove) seem to expect cwd set to the repo # TODO: try to go along without this, because it prevents serving # multiple repos. Instead pass absolute paths to the commands. # print os.getcwd() os.chdir(self.repo.root) # Verify integrity of the repository util.status("Verify repository '%s' tree..." % self.repo.root) commands.verify(self.ui, self.repo) # self.ui.status("Changelog: %s\n" % self.repo.changelog) print "Status:" pprint(self.repo.status()) self.repo.ui.status( "the default username to be used in commits: %s\n" % self.repo.ui.username()) # self.repo.ui.status("a short form of user name USER %s\n" % self.repo.ui.shortuser(user)) self.ui.status("Expandpath: %s\n" % self.repo.ui.expandpath(repoRoot)) print "Working directory state summary:" self.ui.pushbuffer() commands.summary(self.ui, self.repo, remote=False) res = self.ui.popbuffer().strip() reslines = [tuple(line.split(":", 1)) for line in res.split("\n")] pprint(reslines) print "Repository state summary:" self.ui.pushbuffer() commands.identify(self.ui, self.repo, num=True, id=True, branch=True, tags=True) res = self.ui.popbuffer().strip() reslines = [tuple(line.split(":", 1)) for line in res.split("\n")] pprint(reslines) self._getLog()
def __init__(self, repoRoot): super(HgResourceProvider, self).__init__() self.repoRoot = repoRoot print "Mercurial version %s" % hgversion self.ui = mercurial.ui.ui() self.repo = hg.repository(self.ui, repoRoot) self.ui.status("Connected to repository %s\n" % self.repo.root) self.repoRoot = self.repo.root # Some commands (remove) seem to expect cwd set to the repo # TODO: try to go along without this, because it prevents serving # multiple repos. Instead pass absolute paths to the commands. # print os.getcwd() os.chdir(self.repo.root) # Verify integrity of the repository util.status("Verify repository '%s' tree..." % self.repo.root) commands.verify(self.ui, self.repo) # self.ui.status("Changelog: %s\n" % self.repo.changelog) print "Status:" pprint(self.repo.status()) self.repo.ui.status("the default username to be used in commits: %s\n" % self.repo.ui.username()) # self.repo.ui.status("a short form of user name USER %s\n" % self.repo.ui.shortuser(user)) self.ui.status("Expandpath: %s\n" % self.repo.ui.expandpath(repoRoot)) print "Working directory state summary:" self.ui.pushbuffer() commands.summary(self.ui, self.repo, remote=False) res = self.ui.popbuffer().strip() reslines = [ tuple(line.split(":", 1)) for line in res.split("\n")] pprint(reslines) print "Repository state summary:" self.ui.pushbuffer() commands.identify(self.ui, self.repo, num=True, id=True, branch=True, tags=True) res = self.ui.popbuffer().strip() reslines = [ tuple(line.split(":", 1)) for line in res.split("\n")] pprint(reslines) self._getLog()