Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:lafenghu
obs-service-tar_scm
hgfixtures.py
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File hgfixtures.py of Package obs-service-tar_scm
#!/usr/bin/python import os from fixtures import Fixtures from utils import mkfreshdir, run_hg class HgFixtures(Fixtures): def init(self): self.create_repo() self.timestamps = { } self.sha1s = { } self.create_commits(2) def run(self, cmd): return run_hg(self.repo_path, cmd) def create_repo(self): os.makedirs(self.repo_path) os.chdir(self.repo_path) self.run('init') c = open('.hg/hgrc', 'w') c.write("[ui]\nusername = %s\n" % self.name_and_email) c.close() self.wd = self.repo_path print "created repo", self.repo_path def do_commit(self, newly_created): self.run('add .') self.run('commit -m%d' % self.next_commit_rev) def get_metadata(self, formatstr): return self.run('log -l1 --template "%s"' % formatstr)[0] def record_rev(self, rev_num): tag = str(rev_num - 1) # hg starts counting changesets at 0 self.revs[rev_num] = tag self.timestamps[tag] = self.get_metadata('{date}') self.sha1s[tag] = self.get_metadata('{node|short}') self.scmlogs.annotate( "Recorded rev %d: id %s, timestamp %s, SHA1 %s" % \ (rev_num, tag, self.timestamps[tag], self.sha1s[tag]) )
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor