Patchwork D382: simplemerge: make context parameters non-optional

login
register
mail settings
Submitter phabricator
Date Aug. 14, 2017, 6:16 a.m.
Message ID <differential-rev-PHID-DREV-vrr7iksq4bva6fvw4yr4-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/22963/
State Superseded
Headers show

Comments

phabricator - Aug. 14, 2017, 6:16 a.m.
phillco created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Also update the function docstring.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/simplemerge.py

CHANGE DETAILS




To: phillco, #hg-reviewers
Cc: mercurial-devel
phabricator - Aug. 25, 2017, 6:34 a.m.
martinvonz added inline comments.

INLINE COMMENTS

> simplemerge.py:428
>      def readctx(ctx):
>          if not ctx:
>              return None

Can this still be true? I.e., is it valid to pass None instead of one of the contexts?

REPOSITORY
  rHG Mercurial

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

To: phillco, #hg-reviewers
Cc: martinvonz, mercurial-devel
phabricator - Aug. 25, 2017, 8:53 p.m.
phillco added inline comments.

INLINE COMMENTS

> martinvonz wrote in simplemerge.py:428
> Can this still be true? I.e., is it valid to pass None instead of one of the contexts?

Sent as https://phab.mercurial-scm.org/D520.

REPOSITORY
  rHG Mercurial

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

To: phillco, #hg-reviewers
Cc: martinvonz, mercurial-devel

Patch

diff --git a/mercurial/simplemerge.py b/mercurial/simplemerge.py
--- a/mercurial/simplemerge.py
+++ b/mercurial/simplemerge.py
@@ -419,13 +419,11 @@ 
 
     return [name_a, name_b, name_base]
 
-def simplemerge(ui, localctx=None, basectx=None, otherctx=None, repo=None,
+def simplemerge(ui, localctx, basectx, otherctx, repo=None,
                 filtereddata=False, **opts):
     """Performs the simplemerge algorithm.
 
-    {local|base|other}ctx are optional. If passed, they (local/base/other) will
-    be read from and the merge result written to (local). You should pass
-    explicit labels in this mode since the default is to use the file paths.
+    The merged result is written into `localctx`.
 
     filtereddata should only be True if the data() in your context returns
     decoded data.