# HG changeset patch # User Dmitry Neverov # Date 1391998073 -3600 # Node ID 34f1fe091b84822f1fb87d35fabaaca86e56402e # Parent 4d543673433fc7fc88d41732f8fa75245de94a1e TW-34823 add logging for merge diff -r 4d543673433f -r 34f1fe091b84 mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialMergeSupport.java --- a/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialMergeSupport.java Mon Feb 03 15:53:56 2014 +0100 +++ b/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialMergeSupport.java Mon Feb 10 03:07:53 2014 +0100 @@ -93,6 +93,7 @@ @NotNull String dstBranch, @NotNull String message, @NotNull MergeOptions options) throws VcsException { + LOG.info("Merge in root " + root + ", revision " + srcRevision + ", destination " + dstBranch); File tmpDir = null; try { tmpDir = HgFileUtil.createTempDir(); @@ -105,14 +106,23 @@ try { repo.merge().withMergeTool(myConfig.getMergeTool()).revision(srcRevision).call(); } catch (MergeConflictException e) { - return MergeResult.createMergeError(detectConflicts(hgRoot, "", repo)); + List conflicts = detectConflicts(hgRoot, "", repo); + LOG.info("Merge failed with conflicts, root " + root + ", revision " + srcRevision + ", destination " + dstBranch + + ", conflicts " + conflicts, e); + return MergeResult.createMergeError(conflicts); } catch (MergeWithWorkingDirAncestor e) { + LOG.info("Merge failed, root " + root + ", revision " + srcRevision + ", destination " + dstBranch, e); return MergeResult.createMergeError(e.getMessage()); } repo.commit().by(hgRoot.getUserForTag()).message(message).call(); - repo.push().toRepository(hgRoot.getRepository()).call(); + try { + repo.push().toRepository(hgRoot.getRepository()).call(); + } catch (VcsException e) { + LOG.info("Error while pushing a merge commit, root " + root + ", revision " + srcRevision + ", destination " + dstBranch, e); + throw e; + } return MergeResult.createMergeSuccessResult(); } catch (Exception e) { if (e instanceof VcsException)