/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-12 21:51:49 UTC
  • Revision ID: tim@ed.am-20140212215149-msaxl7vo98il5i4a
added more commands

Show diffs side-by-side

added added

removed removed

86
86
                deployment = Deployment()
87
87
                deployment.check_ongoing( True )
88
88
 
 
89
                # check for conflicts
89
90
                message = ''
90
 
 
91
 
                # check for conflicts in repo
92
 
                files = the.repo.vcs.get_conflicts()
93
 
                if files:
 
91
                conflicts = the.repo.vcs.has_conflicts()
 
92
                if conflicts:
94
93
                        message += 'Conflicts in %s:\n  %s' % \
95
 
                                           ( the.repo.name, '\n  '.join( files ) )
96
 
 
97
 
                # check for deployment conclicts
98
 
                conflicts = deployment.get_conflicts()
 
94
                                           ( the.repo.name, '\n  '.join( conflicts ) )
 
95
                conflicts = deployment.check_conflicts()
99
96
                if conflicts:
100
97
                        message += 'Deployment conflicts:\n  %s' % \
101
98
                                           '\n  '.join( conflicts )
102
 
 
103
 
                # stop if there are conflicts
104
99
                if message:
105
 
                        raise the.program.FatalError(
106
 
                                'there were conflicts...\n' + message )
 
100
                        raise the.program.FatalError( 'there are conflicts:\n' + message )
107
101
 
108
102
                # copy-out changes from repo
109
 
                deployment.copy_out()
 
103
                try:
 
104
                        deployment.copy_out()
 
105
                except deployment.Conflict as e:
 
106
                        raise the.program.FatalError( e.msg )
110
107
 
111
108
                # now we've copied-out, revert any copied-in changes!
112
109
                if the.verbose: print "reverting %s" % the.repo.dir