Patchwork [5,of,9,mergedriver] filemerge: add a precheck for symlinks

login
register
mail settings
Submitter Siddharth Agarwal
Date Oct. 7, 2015, 7:33 a.m.
Message ID <fe7e0a3d986f45a4d9f6.1444203220@dev6666.prn1.facebook.com>
Download mbox | patch
Permalink /patch/10847/
State Accepted
Headers show

Comments

Siddharth Agarwal - Oct. 7, 2015, 7:33 a.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1444197393 25200
#      Tue Oct 06 22:56:33 2015 -0700
# Node ID fe7e0a3d986f45a4d9f65ad4e85618dd1fc1264f
# Parent  8565edbcce1d540c478149eee0a92dbca556c65b
filemerge: add a precheck for symlinks

This will be used by internal merge tools.

Patch

diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
--- a/mercurial/filemerge.py
+++ b/mercurial/filemerge.py
@@ -228,6 +228,14 @@  def _premerge(repo, toolconf, files, lab
             util.copyfile(back, a) # restore from backup and try again
     return 1 # continue merging
 
+def _symlinkcheck(repo, mynode, orig, fcd, fco, fca, toolconf):
+    tool, toolpath, binary, symlink = toolconf
+    if symlink:
+        repo.ui.warn(_('warning: internal :merge cannot merge symlinks '
+                       'for %s\n') % fcd.path())
+        return False
+    return True
+
 def _merge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels, mode):
     """
     Uses the internal non-interactive simple merge algorithm for merging