D5410: merge: allow to merge non-conflicting changes outside narrowspec

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Tue Dec 11 11:22:08 UTC 2018


pulkit created this revision.
Herald added a reviewer: durin42.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This patch allows merging of non-conflicting changes outside narrowspec.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D5410

AFFECTED FILES
  mercurial/merge.py
  tests/test-narrow-merge.t

CHANGE DETAILS

diff --git a/tests/test-narrow-merge.t b/tests/test-narrow-merge.t
--- a/tests/test-narrow-merge.t
+++ b/tests/test-narrow-merge.t
@@ -80,16 +80,14 @@
   (no more unresolved files)
   $ hg commit -m 'merge inside/f1'
 
-TODO: Can merge non-conflicting changes outside narrow spec
+Can merge non-conflicting changes outside narrow spec
 
   $ hg update -q 'desc("modify inside/f1")'
   $ hg merge 'desc("modify outside/f1")'
-  abort: merge affects file 'outside/f1' outside narrow, which is not yet supported (flat !)
-  abort: merge affects file 'outside/' outside narrow, which is not yet supported (tree !)
-  (merging in the other direction may work)
-  [255]
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
 
-  $ hg update -q 'desc("modify outside/f1")'
+  $ hg update -q 'desc("modify outside/f1")' -C
   $ hg merge 'desc("modify inside/f1")'
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -1109,10 +1109,7 @@
         elif action[0] in nooptypes:
             del actions[f] # merge does not affect file
         elif action[0] in nonconflicttypes:
-            raise error.Abort(_('merge affects file \'%s\' outside narrow, '
-                                'which is not yet supported') % f,
-                              hint=_('merging in the other direction '
-                                     'may work'))
+            del actions[f]
         else:
             raise error.Abort(_('conflict in file \'%s\' is outside '
                                 'narrow clone') % f)



To: pulkit, durin42, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list