You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixed issue where untracked files are not cleaned during update by introducing a --clean-files#215
To ensure that this is not used by accident the full command is `mbed update --clean --clean-files`
Also rename --force switch to --clean-deps for consistency, e..g `mbed update --clean --clean-deps`
warning("Unable to cache \"%s\" to \"%s\""% (self.path, cpath))
1051
1055
returnFalse
1052
1056
1053
-
defcan_update(self, clean, force):
1057
+
defcan_update(self, clean, clean_deps):
1054
1058
err=None
1055
-
if (self.is_localorself.urlisNone) andnotforce:
1059
+
if (self.is_localorself.urlisNone) andnotclean_deps:
1056
1060
err= (
1057
1061
"Preserving local library \"%s\" in \"%s\".\nPlease publish this library to a remote URL to be able to restore it at any time."
1058
1062
"You can use --ignore switch to ignore all local libraries and update only the published ones.\n"
1059
-
"You can also use --force switch to remove all local libraries. WARNING: This action cannot be undone."% (self.name, self.path))
1063
+
"You can also use --clean-deps switch to remove all local libraries. WARNING: This action cannot be undone."% (self.name, self.path))
1060
1064
elifnotcleanandself.dirty():
1061
1065
err= (
1062
1066
"Uncommitted changes in \"%s\" in \"%s\".\nPlease discard or stash them first and then retry update.\n"
1063
1067
"You can also use --clean switch to discard all uncommitted changes. WARNING: This action cannot be undone."% (self.name, self.path))
1064
-
elifnotforceandself.outgoing():
1068
+
elifnotclean_depsandself.outgoing():
1065
1069
err= (
1066
1070
"Unpublished changes in \"%s\" in \"%s\".\nPlease publish them first using the \"publish\" command.\n"
1067
-
"You can also use --force to discard all local commits and replace the library with the one included in this revision. WARNING: This action cannot be undone."% (self.name, self.path))
1071
+
"You can also use --clean-deps to discard all local commits and replace the library with the one included in this revision. WARNING: This action cannot be undone."% (self.name, self.path))
dict(name='rev', nargs='?', help='Revision, tag or branch'),
1673
-
dict(name=['-C', '--clean'], action='store_true', help='Perform a clean update and discard all local changes. WARNING: This action cannot be undone. Use with caution.'),
1674
-
dict(name=['-F', '--force'], action='store_true', help='Enforce the original layout and will remove any local libraries and also libraries containing uncommitted or unpublished changes. WARNING: This action cannot be undone. Use with caution.'),
1677
+
dict(name=['-C', '--clean'], action='store_true', help='Perform a clean update and discard all modified or untracked files. WARNING: This action cannot be undone. Use with caution.'),
1678
+
dict(name='--clean-files', action='store_true', help='Remove any local ignored files. Requires \'--clean\'. WARNING: This will wipe all local uncommitted, untracked and ignored files. Use with extreme caution.'),
1679
+
dict(name='--clean-deps', action='store_true', help='Remove any local libraries and also libraries containing uncommitted or unpublished changes. Requires \'--clean\'. WARNING: This action cannot be undone. Use with caution.'),
1675
1680
dict(name=['-I', '--ignore'], action='store_true', help='Ignore errors related to unpublished libraries, unpublished or uncommitted changes, and attempt to update from associated remote repository URLs.'),
1676
1681
dict(name='--depth', nargs='?', help='Number of revisions to fetch from the remote repository. Default: all revisions.'),
1677
1682
dict(name='--protocol', nargs='?', help='Transport protocol for the source control management. Supported: https, http, ssh, git. Default: inferred from URL.'),
0 commit comments