/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: 2021-07-05 19:11:53 UTC
  • Revision ID: tim@ed.am-20210705191153-5jcbb6lxv5i15ypx
fix debian dist-package installation

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
 
 
41
 
 
42
        def has_authority( self ):
 
43
                """Check that the directory is under this VCS's control.
 
44
                """
 
45
 
 
46
                return os.path.exists( os.path.join( self.dir, '.bzr' ) )
 
47
 
 
48
 
 
49
        def expand_repo_url( self, url ):
 
50
                """Convert a simple hostname in to an URL that the VCS can use.
 
51
                """
 
52
 
 
53
                return 'bzr+ssh://%s/%s/%s' % ( url, the.dir, the.repo.name )
39
54
 
40
55
 
41
56
        def init( self ):
272
287
                """
273
288
 
274
289
                # bzr commit
275
 
                self.run( [ 'bzr', 'commit', '-m', '' ] )
 
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
276
299
 
277
300
 
278
301
        def run( self, cmd ):
283
306
                if p.returncode > 0:
284
307
                        raise self.VcsError( ' '.join( cmd[ : 2 ] ), output )
285
308
                if the.verbose >= 2:
286
 
                        print re.sub( '(^|\n)', '\\1  > ', output.rstrip() )
 
309
                        verbose_output = output.rstrip()
 
310
                        if len( verbose_output ):
 
311
                                print re.sub( '(^|\n)', '\\1  : ', verbose_output )
287
312
                return output
288
313
 
289
314