Mercurial > hg
comparison hgext/largefiles/overrides.py @ 18066:abe9799a86d6
largefiles: align rm warnings with warnings used in core
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Thu, 13 Dec 2012 19:19:06 +0100 |
parents | 848c428bb5ee |
children | 11d1a9143adb |
comparison
equal
deleted
inserted
replaced
18065:2acd9c14b0d7 | 18066:abe9799a86d6 |
---|---|
135 manifest = repo[None].manifest() | 135 manifest = repo[None].manifest() |
136 modified, added, deleted, clean = [[f for f in list | 136 modified, added, deleted, clean = [[f for f in list |
137 if lfutil.standin(f) in manifest] | 137 if lfutil.standin(f) in manifest] |
138 for list in [s[0], s[1], s[3], s[6]]] | 138 for list in [s[0], s[1], s[3], s[6]]] |
139 | 139 |
140 def warn(files, reason): | 140 def warn(files, msg): |
141 for f in files: | 141 for f in files: |
142 ui.warn(_('not removing %s: %s (use forget to undo)\n') | 142 ui.warn(msg % m.rel(f)) |
143 % (m.rel(f), reason)) | |
144 return int(len(files) > 0) | 143 return int(len(files) > 0) |
145 | 144 |
146 result = 0 | 145 result = 0 |
147 | 146 |
148 if after: | 147 if after: |
149 remove, forget = deleted, [] | 148 remove, forget = deleted, [] |
150 result = warn(modified + added + clean, _('file still exists')) | 149 result = warn(modified + added + clean, |
150 _('not removing %s: file still exists\n')) | |
151 else: | 151 else: |
152 remove, forget = deleted + clean, [] | 152 remove, forget = deleted + clean, [] |
153 result = warn(modified, _('file is modified')) | 153 result = warn(modified, _('not removing %s: file is modified (use -f' |
154 result = warn(added, _('file has been marked for add')) or result | 154 ' to force removal)\n')) |
155 result = warn(added, _('not removing %s: file has been marked for add' | |
156 ' (use forget to undo)\n')) or result | |
155 | 157 |
156 for f in sorted(remove + forget): | 158 for f in sorted(remove + forget): |
157 if ui.verbose or not m.exact(f): | 159 if ui.verbose or not m.exact(f): |
158 ui.status(_('removing %s\n') % m.rel(f)) | 160 ui.status(_('removing %s\n') % m.rel(f)) |
159 | 161 |