diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/darcs.py | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/modules/darcs.py b/modules/darcs.py index 2ca2f6c..ac1f013 100644 --- a/modules/darcs.py +++ b/modules/darcs.py @@ -50,6 +50,7 @@ class Darcs(RevisionControl): self.cfg['source'] = '.' with pwd(self.branch_dir): self.get(self.dir, 'orig') + self.set_current_src() def get(self, src, tgt, *args): @@ -135,7 +136,6 @@ class Darcs(RevisionControl): handling, we may ask the user to commit all the changes to darcs, and then have devshell generate .patch files automatically instead ''' - log.debug(getcwd()) with pwd(self.cfg['source']): p = Popen(['darcs', 'changes', '--xml-output', '--last=1'], stdout = PIPE, stderr = PIPE) @@ -144,30 +144,36 @@ class Darcs(RevisionControl): date = date_re.search(change).groups()[0] self.cfg['head'] = (hash, date) - def set_cur_to(self, branch_name='', *args): + def set_cur_to(self, *args): '''passes arbitrary args to darcs get and makes a branch out of it this is not really optimal, because it only does things temporary, we need to look at as systematic way to handle branching. looking at a potential git and a potential cvs module may help ''' + if len(args) >= 2 and args[0] == 'new': + branch_name = args[1] + args = args[2:] + else: + branch_name = '' if len(args) == 1 and args[0] == 'head': + log.debug('doing head') self.cfg['source'] = '.' - if len(args) == 2 and args[0] == 'branch': + elif len(args) == 2 and args[0] == 'branch': self.cfg['source'] = join(self.branch, args[1]) else: - index = hash(args) + log.debug('creating new branch') + index = str(hash(args)) index_dir = join(self.branch, index) with pwd(self.dir): if not exists(index_dir): + log.debug('index dir should be ' + index_dir) self.get(self.source(), index_dir, *args) self.cfg['source'] = index_dir + self.set_current_src() if branch_name: with pwd(self.branch_dir): self.get(index, branch_name) -# cur_src_dir = self.cfg['source'] -# new_src_dir = cur_src_dir + '_tmp' -# self.get(cur_src_dir, new_src_dir, *args) def set_cur_to_patch(self, hash): '''sets the current branch to fork off a particular hash''' @@ -208,13 +214,12 @@ class Darcs(RevisionControl): yield - def setup_sourceball(self): + def setup_sourceball(self, ver): '''gets darcs to spit out a sourceball to be used in rpm making by other modules''' log.debug('someone set us up the bomb') with pwd(self.dir): with pwd(self.source_dir()): name = self.hackage_name - ver = self.ver() date = self.date full_name = '%s-%s.%sdarcs' % (name, ver, date) log.debug('full name is ' + full_name) |