/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/command_resolve.py

  • Committer: Tim Marston
  • Date: 2014-02-26 19:10:31 UTC
  • Revision ID: tim@ed.am-20140226191031-elcqy5j09h2syn2j
moved copy-in, copy-out and deployment conflict checking to a set of "walkers";
bzr vcs back-end now parses affected files during update; deployment state now
includes affected files

Show diffs side-by-side

added added

removed removed

1
 
# resolve.py
 
1
# command_resolve.py
2
2
#
3
3
# Copyright (C) 2014 Tim Marston <tim@edm.am>
4
4
#
20
20
 
21
21
 
22
22
import sys, re, getopt
23
 
from command import Command
24
 
import stdhome.the as the
25
 
from stdhome.deployment import Deployment
26
 
 
27
 
 
28
 
class ResolveCommand( Command ):
 
23
import the
 
24
from deployment import Deployment
 
25
 
 
26
 
 
27
class CommandResolve:
29
28
 
30
29
 
31
30
        def __init__( self ):
65
64
                                                'invalid repository name: ' + optarg )
66
65
                                self.repo = optarg
67
66
                        elif opt in [ '--verbose', '-v' ]:
68
 
                                the.verbose += 1
 
67
                                the.verbose = True
69
68
                        elif opt == "--help":
70
69
                                self.print_help()
71
70
                
92
91
                # check for conflicts in repo
93
92
                files = the.repo.vcs.get_conflicts()
94
93
                if files:
95
 
                        message += 'conflicts in %s:\n  %s' % \
 
94
                        message += 'Conflicts in %s:\n  %s' % \
96
95
                                           ( the.repo.name, '\n  '.join( files ) )
97
96
 
98
97
                # check for deployment conclicts
99
98
                conflicts = deployment.get_conflicts()
100
99
                if conflicts:
101
 
                        message += 'deployment conflicts:\n  %s' % \
 
100
                        message += 'Deployment conflicts:\n  %s' % \
102
101
                                           '\n  '.join( conflicts )
103
102
 
104
103
                # stop if there are conflicts