Patchwork D6505: dagop: fix documentation of reachableroots

login
register
mail settings
Submitter phabricator
Date June 10, 2019, 4:46 p.m.
Message ID <differential-rev-PHID-DREV-2w57lilogdgnt6ncvkd6-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/40404/
State Superseded
Headers show

Comments

phabricator - June 10, 2019, 4:46 p.m.
valentin.gatienbaron created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  The previous revset couldn't be correct as it is symmetric in <roots>
  and <heads>, but reachableroots has no such symmetry. It makes a
  difference with for instance reachableroots(2, 3) where 2 and 3 are
  both children of 1.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/dagop.py

CHANGE DETAILS




To: valentin.gatienbaron, #hg-reviewers
Cc: mercurial-devel
phabricator - June 10, 2019, 11:07 p.m.
pulkit added inline comments.

INLINE COMMENTS

> dagop.py:265
> -
> -    If includepath is True, return (<roots>::<heads>)."""
>      if not roots:

if this doc about `includepath` was correct, let's keep it.

REPOSITORY
  rHG Mercurial

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

To: valentin.gatienbaron, #hg-reviewers
Cc: pulkit, mercurial-devel
phabricator - June 10, 2019, 11:14 p.m.
pulkit added inline comments.

INLINE COMMENTS

> pulkit wrote in dagop.py:265
> if this doc about `includepath` was correct, let's keep it.

ignore me here, now I saw the next patch.

REPOSITORY
  rHG Mercurial

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

To: valentin.gatienbaron, #hg-reviewers
Cc: pulkit, mercurial-devel

Patch

diff --git a/mercurial/dagop.py b/mercurial/dagop.py
--- a/mercurial/dagop.py
+++ b/mercurial/dagop.py
@@ -260,9 +260,7 @@ 
                 break
 
 def _reachablerootspure(repo, minroot, roots, heads, includepath):
-    """return (heads(::<roots> and ::<heads>))
-
-    If includepath is True, return (<roots>::<heads>)."""
+    """See reachableroots"""
     if not roots:
         return []
     parentrevs = repo.changelog.parentrevs
@@ -298,7 +296,7 @@ 
     return reachable
 
 def reachableroots(repo, roots, heads, includepath=False):
-    """return (heads(::<roots> and ::<heads>))
+    """return (heads(::<roots> and <roots>::<heads>))
 
     If includepath is True, return (<roots>::<heads>)."""
     if not roots: