/stdhome

To get this branch, use:
bzr branch http://bzr.ed.am/stdhome

« back to all changes in this revision

Viewing changes to lib/stdhome/vcs/bzr.py

  • Committer: Tim Marston
  • Date: 2016-02-23 22:37:03 UTC
  • Revision ID: tim@ed.am-20160223223703-sx94svvstwt8xvrb
determine and instantiate repo vcs dynamically; for new repos, added default vcs
configuration option and allow override in init command arguments; re-added
handling of -v/--verbose arguments to commands and removed from program (since
there may be problems parsing all arguments here)

Show diffs side-by-side

added added

removed removed

36
36
                """
37
37
 
38
38
                self.dir = dir
39
 
                self.ignored_files = [ '.bzr', '.bzrignore' ]
40
39
 
41
40
 
42
41
        def has_authority( self ):
287
286
                """
288
287
 
289
288
                # bzr commit
290
 
                try:
291
 
                        self.run( [ 'bzr', 'commit', '-m', '' ] )
292
 
                except self.VcsError as e:
293
 
                        if re.search( 'Working tree is out of date', e.output ):
294
 
                                raise the.program.FatalError(
295
 
                                        'you must update your files first.\n' +
296
 
                                        'Hint: see "%s update --help"' % the.program.name );
297
 
                        else:
298
 
                                raise e
 
289
                self.run( [ 'bzr', 'commit', '-m', '' ] )
299
290
 
300
291
 
301
292
        def run( self, cmd ):
306
297
                if p.returncode > 0:
307
298
                        raise self.VcsError( ' '.join( cmd[ : 2 ] ), output )
308
299
                if the.verbose >= 2:
309
 
                        verbose_output = output.rstrip()
310
 
                        if len( verbose_output ):
311
 
                                print re.sub( '(^|\n)', '\\1  : ', verbose_output )
 
300
                        print re.sub( '(^|\n)', '\\1  > ', output.rstrip() )
312
301
                return output
313
302
 
314
303