Lines 227-235
Link Here
|
227 |
} |
227 |
} |
228 |
|
228 |
|
229 |
private void hgMoveImplementation(final File srcFile, final File dstFile) throws IOException { |
229 |
private void hgMoveImplementation(final File srcFile, final File dstFile) throws IOException { |
230 |
Mercurial hg = Mercurial.getInstance(); |
230 |
final Mercurial hg = Mercurial.getInstance(); |
231 |
final File root = hg.getTopmostManagedParent(srcFile); |
231 |
final File root = hg.getTopmostManagedParent(srcFile); |
|
|
232 |
if (root == null) return; |
232 |
|
233 |
|
|
|
234 |
RequestProcessor rp = hg.getRequestProcessor(root.getAbsolutePath()); |
235 |
|
236 |
Runnable moveImpl = new Runnable() { |
237 |
public void run() { |
233 |
try { |
238 |
try { |
234 |
int status = hg.getFileStatusCache().getStatus(srcFile).getStatus(); |
239 |
int status = hg.getFileStatusCache().getStatus(srcFile).getStatus(); |
235 |
if (status == FileInformation.STATUS_NOTVERSIONED_NEWLOCALLY) { |
240 |
if (status == FileInformation.STATUS_NOTVERSIONED_NEWLOCALLY) { |
Lines 242-253
Link Here
|
242 |
HgCommand.doRename(root, srcFile, dstFile); |
247 |
HgCommand.doRename(root, srcFile, dstFile); |
243 |
} |
248 |
} |
244 |
} catch (HgException e) { |
249 |
} catch (HgException e) { |
245 |
IOException ex = new IOException("Mercurial failed to rename " + srcFile.getAbsolutePath() + " to: " + dstFile.getAbsolutePath()); // NOI18N |
250 |
Mercurial.LOG.log(Level.FINE, "Mercurial failed to rename: File: {0} {1} {2}", new Object[] {srcFile.getAbsolutePath(), dstFile.getAbsolutePath()}); // NOI18N |
246 |
ex.initCause(e); |
|
|
247 |
throw ex; |
248 |
} |
251 |
} |
249 |
} |
252 |
} |
|
|
253 |
}; |
250 |
|
254 |
|
|
|
255 |
rp.post(moveImpl).waitFinished(); |
256 |
} |
257 |
|
251 |
public void afterMove(final File from, final File to) { |
258 |
public void afterMove(final File from, final File to) { |
252 |
Utils.post(new Runnable() { |
259 |
Utils.post(new Runnable() { |
253 |
public void run() { |
260 |
public void run() { |
Lines 294-302
Link Here
|
294 |
|
301 |
|
295 |
private void fileCreatedImpl(final File file) { |
302 |
private void fileCreatedImpl(final File file) { |
296 |
if (file.isDirectory()) return; |
303 |
if (file.isDirectory()) return; |
|
|
304 |
Mercurial hg = Mercurial.getInstance(); |
305 |
final File root = hg.getTopmostManagedParent(file); |
306 |
if (root == null) return; |
307 |
|
308 |
RequestProcessor rp = hg.getRequestProcessor(root.getAbsolutePath()); |
309 |
|
310 |
HgProgressSupport supportCreate = new HgProgressSupport() { |
311 |
public void perform() { |
297 |
cache.refresh(file, FileStatusCache.REPOSITORY_STATUS_UNKNOWN); |
312 |
cache.refresh(file, FileStatusCache.REPOSITORY_STATUS_UNKNOWN); |
298 |
} |
313 |
} |
|
|
314 |
}; |
299 |
|
315 |
|
|
|
316 |
supportCreate.start(rp, root.getAbsolutePath(), |
317 |
org.openide.util.NbBundle.getMessage(MercurialInterceptor.class, "MSG_Create_Progress")); // NOI18N |
318 |
} |
319 |
|
300 |
public void afterChange(final File file) { |
320 |
public void afterChange(final File file) { |
301 |
Utils.post(new Runnable() { |
321 |
Utils.post(new Runnable() { |
302 |
public void run() { |
322 |
public void run() { |
Lines 305-312
Link Here
|
305 |
}); |
325 |
}); |
306 |
} |
326 |
} |
307 |
|
327 |
|
308 |
private void fileChangedImpl(File file) { |
328 |
private void fileChangedImpl(final File file) { |
309 |
if (file.isDirectory()) return; |
329 |
if (file.isDirectory()) return; |
310 |
cache.refreshForce(file, FileStatusCache.REPOSITORY_STATUS_UNKNOWN); |
330 |
Mercurial hg = Mercurial.getInstance(); |
|
|
331 |
final File root = hg.getTopmostManagedParent(file); |
332 |
if (root == null) return; |
333 |
|
334 |
RequestProcessor rp = hg.getRequestProcessor(root.getAbsolutePath()); |
335 |
|
336 |
HgProgressSupport supportCreate = new HgProgressSupport() { |
337 |
public void perform() { |
338 |
cache.refresh(file, FileStatusCache.REPOSITORY_STATUS_UNKNOWN); |
311 |
} |
339 |
} |
|
|
340 |
}; |
341 |
|
342 |
supportCreate.start(rp, root.getAbsolutePath(), |
343 |
org.openide.util.NbBundle.getMessage(MercurialInterceptor.class, "MSG_Change_Progress")); // NOI18N |
312 |
} |
344 |
} |
|
|
345 |
} |