Mercurial > jhg
comparison src/org/tmatesoft/hg/core/HgMergeCommand.java @ 708:4ffc17c0b534
Merge: tests for resolver and complex scenario. Enable commit for merged revisions. Reuse file revisions if nothing changed
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Tue, 20 Aug 2013 18:41:34 +0200 |
parents | 42b88709e41d |
children |
comparison
equal
deleted
inserted
replaced
707:42b88709e41d | 708:4ffc17c0b534 |
---|---|
277 */ | 277 */ |
278 public void unresolved(); | 278 public void unresolved(); |
279 } | 279 } |
280 | 280 |
281 /** | 281 /** |
282 * Base mediator implementation, with regular resolution. | 282 * Base mediator implementation, with regular resolution (and "don't delete anything" approach in mind). |
283 * Subclasses shall implement {@link #resolve(HgFileRevision, HgFileRevision, HgFileRevision, Resolver)} and | 283 * Subclasses shall override methods to provide alternative implementation or to add extra logic (e.g. ask user). |
284 * may optionally provide extra logic (e.g. ask user) for other cases. | |
285 */ | 284 */ |
286 @Experimental(reason="Provisional API. Work in progress") | 285 @Experimental(reason="Provisional API. Work in progress") |
287 public abstract static class MediatorBase implements Mediator { | 286 public static class MediatorBase implements Mediator { |
288 /** | 287 /** |
289 * Implementation keeps this revision | 288 * Implementation keeps this revision |
290 */ | 289 */ |
291 public void same(HgFileRevision rev, Resolver resolver) throws HgCallbackTargetException { | 290 public void same(HgFileRevision rev, Resolver resolver) throws HgCallbackTargetException { |
292 resolver.use(rev); | 291 resolver.use(rev); |
326 /** | 325 /** |
327 * Implementation keeps latest revision | 326 * Implementation keeps latest revision |
328 */ | 327 */ |
329 public void fastForwardB(HgFileRevision base, HgFileRevision second, Resolver resolver) throws HgCallbackTargetException { | 328 public void fastForwardB(HgFileRevision base, HgFileRevision second, Resolver resolver) throws HgCallbackTargetException { |
330 resolver.use(second); | 329 resolver.use(second); |
330 } | |
331 | |
332 /** | |
333 * Implementation marks file as unresolved | |
334 */ | |
335 public void resolve(HgFileRevision base, HgFileRevision first, HgFileRevision second, Resolver resolver) throws HgCallbackTargetException { | |
336 resolver.unresolved(); | |
331 } | 337 } |
332 } | 338 } |
333 | 339 |
334 private static class ResolverImpl implements Resolver { | 340 private static class ResolverImpl implements Resolver { |
335 | 341 |