22
22
import sys, re, getopt
23
from command import Command
24
import stdhome.the as the
25
from stdhome.deployment import Deployment
28
class ResolveCommand( Command ):
24
from deployment import Deployment
31
30
def __init__( self ):
87
86
deployment = Deployment()
88
87
deployment.check_ongoing( True )
92
# check for conflicts in repo
93
files = the.repo.vcs.get_conflicts()
95
message += 'conflicts in %s:\n %s' % \
96
( the.repo.name, '\n '.join( files ) )
98
# check for deployment conclicts
99
conflicts = deployment.get_conflicts()
101
message += 'deployment conflicts:\n %s' % \
91
conflicts = the.repo.vcs.has_conflicts()
93
message += 'Conflicts in %s:\n %s' % \
94
( the.repo.name, '\n '.join( conflicts ) )
95
conflicts = deployment.check_conflicts()
97
message += 'Deployment conflicts:\n %s' % \
102
98
'\n '.join( conflicts )
104
# stop if there are conflicts
106
raise the.program.FatalError(
107
'there were conflicts...\n' + message )
100
raise the.program.FatalError( 'there are conflicts:\n' + message )
109
102
# copy-out changes from repo
110
deployment.copy_out()
104
deployment.copy_out()
105
except deployment.Conflict as e:
106
raise the.program.FatalError( e.msg )
112
108
# now we've copied-out, revert any copied-in changes!
113
109
if the.verbose: print "reverting %s" % the.repo.dir