1515import os
1616import os .path
1717import sys
18- import textwrap
1918
2019from manic .externals_description import create_externals_description
2120from manic .externals_description import read_externals_description_file
@@ -108,7 +107,7 @@ def commandline_arguments(args=None):
108107 $ ./manage_externals/%(prog)s --status
109108
110109 ./cime
111- m ./components/cism
110+ s ./components/cism
112111 ./components/mosart
113112 e-o ./components/rtm
114113 M ./src/fates
@@ -121,17 +120,18 @@ def commandline_arguments(args=None):
121120 * column two indicates whether the working copy has modified files.
122121 * column three shows how the repository is managed, optional or required
123122
124- Colunm one will be one of these values:
125- * m : modified : repository is modified compared to the externals description
123+ Column one will be one of these values:
124+ * s : out-of-sync : repository is checked out at a different commit
125+ compared with the externals description
126126 * e : empty : directory does not exist - %(prog)s has not been run
127127 * ? : unknown : directory exists but .git or .svn directories are missing
128128
129- Colunm two will be one of these values:
130- * M : Modified : untracked, modified, added, deleted or missing files
129+ Column two will be one of these values:
130+ * M : Modified : modified, added, deleted or missing files
131131 * : blank / space : clean
132132 * - : dash : no meaningful state, for empty repositories
133133
134- Colunm three will be one of these values:
134+ Column three will be one of these values:
135135 * o : optional : optionally repository
136136 * : blank / space : required repository
137137
@@ -260,7 +260,8 @@ def main(args):
260260 datefmt = '%Y-%m-%d %H:%M:%S' ,
261261 level = logging .DEBUG )
262262
263- logging .info ('Begining of checkout_externals' )
263+ program_name = os .path .basename (sys .argv [0 ])
264+ logging .info ('Beginning of %s' , program_name )
264265
265266 load_all = False
266267 if args .optional :
@@ -287,19 +288,28 @@ def main(args):
287288 for comp in sorted (tree_status .keys ()):
288289 tree_status [comp ].log_status_message (args .verbose )
289290 # exit gracefully
290- msg = textwrap .fill (
291- 'Some external repositories are not in a clean state. '
292- '(Generally, these are repositories with "M" in the '
293- 'second column in the above status output.) '
294- 'Please ensure all external repositories are clean '
295- 'before updating.' )
291+ msg = """The external repositories labeled with 'M' above are not in a clean state.
292+
293+ The following are two options for how to proceed:
294+
295+ (1) Go into each external that is not in a clean state and issue either
296+ an 'svn status' or a 'git status' command. Either revert or commit
297+ your changes so that all externals are in a clean state. (Note,
298+ though, that it is okay to have untracked files in your working
299+ directory.) Then rerun {program_name}.
300+
301+ (2) Alternatively, you do not have to rely on {program_name}. Instead, you
302+ can manually update out-of-sync externals (labeled with 's' above)
303+ as described in the configuration file {config_file}.
304+ """ .format (program_name = program_name , config_file = args .externals )
305+
296306 printlog ('-' * 70 )
297307 printlog (msg )
298308 printlog ('-' * 70 )
299309 else :
300310 source_tree .checkout (args .verbose , load_all )
301311 printlog ('' )
302312
303- logging .info ('checkout_externals completed without exceptions.' )
313+ logging .info ('%s completed without exceptions.' , program_name )
304314 # NOTE(bja, 2017-11) tree status is used by the systems tests
305315 return 0 , tree_status
0 commit comments