def getByRevision(self, instance, name, rev): """ """ info = dict(self.getInfoByRevision(instance, name, rev)) filename = info['filename'] filepath = os.path.join(self.getRootPath(), info['filepath']) if filename: filepath = os.path.join(filepath, filename) return utils.system('hg cat -R %s -r %s %s' % (self.getRootPath(), rev, filepath))
def commit(self, transaction): portal = getSite() try: mship = getToolByName(portal, 'portal_membership') user = mship.getMemberById(self.userid) email = user.getProperty('email') name = user.getProperty('fullname') except: pass if not email: email = portal.getProperty('email_from_address', '') name = portal.getProperty('email_from_name', '') output = utils.system('hg commit --addremove -v -m "%s" -u "%s <%s>" -R %s' % (self.message, name, email, self.path)) if output and not 'nothing changed' in output: info('\n'+output)
def abort(self, transaction): utils.system('hg revert --all -R %s' % self.path)
def getRevision(self, instance, name): return utils.system('hg tip -R %s --template "{node}"' % self.getRootPath())