22
22
import sys, re, getopt
24
from deployment import Deployment
23
from command import Command
24
import stdhome.the as the
25
from stdhome.deployment import Deployment
26
from stdhome.walker.status import StatusWalker
29
class StatusCommand( Command ):
30
32
def __init__( self ):
82
84
the.set_repo( self.repo )
83
85
the.repo.check_dir_exists()
89
# initialise deployment and check if it's ongoing
85
90
deployment = Deployment()
88
# check for differing files
89
files = deployment.get_diffs()
91
message += 'Modified files in %s\n %s\n' % \
92
( the.fsdir, '\n '.join( files ) )
95
files = the.repo.vcs.get_conflicts()
97
message += 'Conflicts in %s:\n %s\n' % \
98
( the.repo.dir, '\n '.join( files ) )
99
91
if deployment.is_ongoing():
100
files = deployment.get_conflicts()
93
# check for conflicts in repo
94
files = the.repo.vcs.get_conflicts()
96
message += 'Conflicts in %s:\n %s\n' % \
97
( the.repo.name, '\n '.join( files ) )
99
# get deployment conflicts
100
conflicts = deployment.get_conflicts()
102
102
message += 'Deployment conflicts:\n %s\n' % \
103
'\n '.join( conflicts )
108
walker = StatusWalker()
111
message += 'Modified:\n %s\n' % \
112
'\n '.join( walker.modified )
114
message += 'Missing:\n %s\n' % \
115
'\n '.join( walker.missing )
117
message += 'Type changed:\n %s\n' % \
118
'\n '.join( walker.changed )
106
121
if message: print message.rstrip()