[PATCH 0 of 2 STABLE] annotation: fix problems in the tree merging a revision and its ancestor

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Thu Mar 28 06:48:38 CDT 2013


At Thu, 28 Mar 2013 19:36:56 +0900,
FUJIWARA Katsunori wrote:
> 
> This patch series fixes issue3841.
> 
> You'll notice one more issue in "filectx.annotation" that annotation
> result for the recent common ancestor of merged revisions is kept in
> "hist", even if it isn't referred any more.
> 
> I'm planning to post it separately as improvement of memory
> efficiency, because it doesn't affect result of annotation.

I've examined validity of this patch series with the filelog of
"mercurial/commands.py" in the repository of Mercurial itself.

    (1) 10 --- 11 --- 12
                  \_/

        # filelogrev    linkrev
        # 10            230:00ea3613f82c
        # 11            232:fc4a6e5b5812
        # 12            237:4f802588cdfb

        check changes in 10(rev 230) can show in annotation for 12(rev 237)

        $ hg annotate -r 237 mercurial/commands.py |
          grep "(c, a, d, u) = repo.diffdir(repo.root)"

        (BAD)
        232:     (c, a, d, u) = repo.diffdir(repo.root)
        232:     (c, a, d, u) = repo.diffdir(repo.root)
        (GOOD)
        230:     (c, a, d, u) = repo.diffdir(repo.root)
        230:     (c, a, d, u) = repo.diffdir(repo.root)

    (2) 37 --- 38 --- 39 --- 40
                  \________/

        # filelogrev    linkrev
        # 37            294:f8d56da6ac8f
        # 38            295:38919e1c254d
        # 39            300:d3400605d246
        # 40            306:f06a4a3b86a7

        check changes in 37(rev 294) can show in annotation for 40(rev 306)

        $ hg annotate -r 306 mercurial/commands.py |
          grep "def patch("

        (BAD)
        295: def patch(ui, repo, patch1, *patches, **opts):
        (GOOD)
        294: def patch(ui, repo, patch1, *patches, **opts):

As describing in each patch descriptions, issue3841 occurs only on
repositories which include the revision merging a revision and its
ancestor, and recent Mercurial doesn't allow such merging.

So, there is no easy way to build the repository to examine validity
of these patches.

Should I also add the test to examine validity of these patches by one
of ways shown below (or another) ?:

   (A) testing on the repository of Mercurial itself by the way like
       in "test-check-code-hg.t"

       $ if hg identify -q > /dev/null 2>&1; then :
       > else
       >     echo "skipped: not a Mercurial working dir" >&2
       >     exit 80
       > fi

       This seems to require aborting whole of "test-annotate.t" (or
       adding another test), when tested not in the repository.

       Should I add some feature check like "has_ownhistory" or so to
       skip just part of "test-annotate.t" ?

   (B) testing on the repository created from the bundle of the
       repository built by old-hg command

----------------------------------------------------------------------
[FUJIWARA Katsunori]                             foozy at lares.dti.ne.jp


More information about the Mercurial-devel mailing list