##// END OF EJS Templates
largefiles: align rm warnings with warnings used in core
Mads Kiilerich -
r18066:abe9799a default
parent child Browse files
Show More
@@ -137,21 +137,23 b' def removelargefiles(ui, repo, *pats, **'
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):
@@ -79,15 +79,25 b' Test status, subdir and unknown files'
79 C sub/normal2
79 C sub/normal2
80 $ rm sub/unknown
80 $ rm sub/unknown
81
81
82 Test exit codes for remove warning cases (modified and still exiting)
82 Test messages and exit codes for remove warning cases
83
83
84 $ hg remove -A large1
84 $ hg remove -A large1
85 not removing large1: file still exists (use forget to undo)
85 not removing large1: file still exists
86 [1]
86 [1]
87 $ echo 'modified' > large1
87 $ echo 'modified' > large1
88 $ hg remove large1
88 $ hg remove large1
89 not removing large1: file is modified (use forget to undo)
89 not removing large1: file is modified (use -f to force removal)
90 [1]
90 [1]
91 $ echo 'new' > normalnew
92 $ hg add normalnew
93 $ echo 'new' > largenew
94 $ hg add --large normalnew
95 normalnew already tracked!
96 $ hg remove normalnew largenew
97 not removing largenew: file is untracked
98 not removing normalnew: file has been marked for add (use forget to undo)
99 [1]
100 $ rm normalnew largenew
91 $ hg up -Cq
101 $ hg up -Cq
92
102
93 Remove both largefiles and normal files.
103 Remove both largefiles and normal files.
General Comments 0
You need to be logged in to leave comments. Login now