Mercurial > jhg
comparison src/org/tmatesoft/hg/repo/HgWorkingCopyStatusCollector.java @ 473:5c09a9f2e073
Issue 34: incorrect status for a file copy in wc against base rev
| author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
|---|---|
| date | Wed, 11 Jul 2012 22:45:29 +0200 |
| parents | 7bcfbc255f48 |
| children | b3c16d1aede0 |
comparison
equal
deleted
inserted
replaced
| 472:2a0b09eec376 | 473:5c09a9f2e073 |
|---|---|
| 268 // from baseRevFiles, it might need to be reported as removed as well (cmdline client does | 268 // from baseRevFiles, it might need to be reported as removed as well (cmdline client does |
| 269 // yield two statuses for the same file) | 269 // yield two statuses for the same file) |
| 270 } | 270 } |
| 271 } | 271 } |
| 272 if (collect != null) { | 272 if (collect != null) { |
| 273 // perhaps, this code shall go after processing leftovers of knownEntries, below | |
| 274 // as it's sort of last resort - what to do with otherwise unprocessed base revision files | |
| 273 for (Path fromBase : baseRevFiles) { | 275 for (Path fromBase : baseRevFiles) { |
| 274 if (repoWalker.inScope(fromBase)) { | 276 if (repoWalker.inScope(fromBase)) { |
| 275 inspector.removed(fromBase); | 277 inspector.removed(fromBase); |
| 278 processed.add(fromBase); | |
| 276 cs.checkCancelled(); | 279 cs.checkCancelled(); |
| 277 } | 280 } |
| 278 } | 281 } |
| 279 } | 282 } |
| 280 knownEntries.removeAll(processed); | 283 knownEntries.removeAll(processed); |
| 402 // report failure and continue status collection | 405 // report failure and continue status collection |
| 403 inspector.invalid(fname, ex); | 406 inspector.invalid(fname, ex); |
| 404 } | 407 } |
| 405 } else if ((r = ds.checkAdded(fname)) != null) { | 408 } else if ((r = ds.checkAdded(fname)) != null) { |
| 406 if (r.copySource() != null && baseRevNames.contains(r.copySource())) { | 409 if (r.copySource() != null && baseRevNames.contains(r.copySource())) { |
| 407 baseRevNames.remove(r.copySource()); // FIXME likely I shall report rename source as Removed, same as above for Normal? | 410 // shall not remove rename source from baseRevNames, as the source |
| 411 // likely needs to be reported as Removed as well | |
| 408 inspector.copied(r.copySource(), fname); | 412 inspector.copied(r.copySource(), fname); |
| 409 return; | 413 return; |
| 410 } | 414 } |
| 411 // fall-through, report as added | 415 // fall-through, report as added |
| 412 } else if (ds.checkRemoved(fname) != null) { | 416 } else if (ds.checkRemoved(fname) != null) { |
