22
22
import sys, re, getopt
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 ):
24
from deployment import Deployment
32
30
def __init__( self ):
84
82
the.set_repo( self.repo )
85
83
the.repo.check_dir_exists()
85
deployment = Deployment()
89
# initialise deployment and check if it's ongoing
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 ) )
91
99
if deployment.is_ongoing():
93
# check for conflicts in repo
94
files = the.repo.vcs.get_conflicts()
100
files = deployment.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 )
121
106
if message: print message.rstrip()