29
29
class StatusCommand( Command ):
36
32
def print_help( self ):
37
print "Usage: " + the.program.name + " status [--repo=REPO]"
33
print "Usage: " + the.program.name + " status [--repo=REPO] [FILE]..."
39
35
# 01234567890123456789012345678901234567890123456789012345678901234567890123456789
40
36
print "Show the state of files in the local repository (including modifications and"
43
39
print "This lists files in your home directory that have been modified and which differ"
44
40
print "from those in the local repository. During an update that resulted in conflicts"
45
print "this also lists files which have conflicts in the local local respository, or"
46
print "which can not be deployed due to conflicts with your home directory."
41
print "this also lists files which have conflicts in the local respository, or which"
42
print "can not be deployed due to conflicts with your home directory."
48
44
print "For help with adding modified files to the repository, type:"
49
45
print " " + the.program.name + " add --help"
64
60
if not re.match( '^[-a-zA-z0-9.]+$', optarg ):
65
61
raise the.program.FatalError(
66
62
'invalid repository name: ' + optarg )
68
64
elif opt in [ '--verbose', '-v' ]:
70
66
elif opt == "--help":
76
72
# remaining arguments
78
raise the.program.UsageError( 'too many arguments' )
83
78
# set up repo and check it exists
84
the.set_repo( self.repo )
85
79
the.repo.check_dir_exists()
82
files = self.expand_files( self.files )
89
86
# initialise deployment and check if it's ongoing
90
87
deployment = Deployment()
91
88
if deployment.is_ongoing():
89
print "deployment ongoing"
93
91
# check for conflicts in repo
94
92
files = the.repo.vcs.get_conflicts()
96
message += 'Conflicts in %s:\n %s\n' % \
94
message += 'conflicts in %s:\n %s\n' % \
97
95
( the.repo.name, '\n '.join( files ) )
99
97
# get deployment conflicts
100
98
conflicts = deployment.get_conflicts()
102
message += 'Deployment conflicts:\n %s\n' % \
100
message += 'deployment conflicts:\n %s\n' % \
103
101
'\n '.join( conflicts )
108
walker = StatusWalker()
106
walker = StatusWalker( files if files else None )
110
108
if walker.modified:
111
message += 'Modified:\n %s\n' % \
109
message += 'modified:\n %s\n' % \
112
110
'\n '.join( walker.modified )
113
111
if walker.missing:
114
message += 'Missing:\n %s\n' % \
112
message += 'missing:\n %s\n' % \
115
113
'\n '.join( walker.missing )
116
114
if walker.changed:
117
message += 'Type changed:\n %s\n' % \
115
message += 'kind changed:\n %s\n' % \
118
116
'\n '.join( walker.changed )