[PATCH] cvsps: fix computation of parent revisions when log caching is on
Augie Fackler
raf at durin42.com
Thu Oct 8 12:39:46 CDT 2015
On Wed, Oct 07, 2015 at 01:32:38PM +0300, Emanuele Giaquinta wrote:
> # HG changeset patch
> # User Emanuele Giaquinta <emanuele.giaquinta at gmail.com>
> # Date 1444206832 -10800
> # Wed Oct 07 11:33:52 2015 +0300
> # Node ID cacca520238c70e0411905230c67a7e8132436ef
> # Parent efd57cd6fd1d5eb76102fabfc45676873bbba29d
> cvsps: fix computation of parent revisions when log caching is on
seems mostly good, one question below
>
> cvsps computes the parent revisions of log entries by walking the cvs log
> sorted by (rcs, revision) and by iteratively maintaining a 'versions'
> dictionary which maps a (rcs, branch) pair onto the last revision seen for that
> pair. When log caching is on and a log cache exists, cvsps fails to set the
> parent revisions of new log entries because it does not iterate over the log
> cache in the parents computation. A complication is that a file rcs can change
> (move to/from the attic), with respect to its value in the log cache, if the
> file is removed/added back. This patch adds an iteration over the log cache to
> update the rcs of cached log entries, if changed, and to properly populate the
> 'versions' dictionary.
>
[snip]
> diff -r efd57cd6fd1d -r cacca520238c tests/test-cvsps.t
> --- /dev/null Thu Jan 01 00:00:00 1970 +0000
> +++ b/tests/test-cvsps.t Wed Oct 07 11:33:52 2015 +0300
> @@ -0,0 +1,95 @@
> +#require cvs
is there any way this test can piggyback on one of the existing CVS tests?
> +
> + $ cvscall()
> + > {
> + > cvs -f "$@" > /dev/null
> + > }
> + $ cat <<EOF >> $HGRCPATH
> + > [extensions]
> + > convert =
> + > EOF
> +
> +create cvs repository
> +
> + $ mkdir cvsrepo
> + $ cd cvsrepo
> + $ CVSROOT=`pwd`
> + $ export CVSROOT
> + $ CVS_OPTIONS=-f
> + $ export CVS_OPTIONS
> + $ cd ..
> + $ rmdir cvsrepo
> + $ cvscall -q -d "$CVSROOT" init
> +
> +Create a new project
> +
> + $ mkdir src
> + $ cd src
> + $ echo "1" > a
> + $ echo "1" > b
> + $ cvscall import -m "init" src v0 r0 | sort
> + $ cd ..
> + $ cvscall co src
> + cvs checkout: Updating src
> + $ cd src
> +
> +Create the cvsps cache file
> +
> + $ hg debugcvsps -x >/dev/null
> +
> +Modify file a and remove file b
> +
> + $ echo "2" >> a
> + $ cvscall rm -f b
> + cvs remove: scheduling `b' for removal
> + cvs remove: use 'cvs commit' to remove this file permanently
> + $ cvscall ci -m 'update'
> + cvs commit: Examining .
> +
> +Update and verify the cache file
> +
> + $ hg debugcvsps -u
> + collecting CVS rlog
> + 6 log entries
> + creating changesets
> + 3 changeset entries
> + ---------------------
> + PatchSet 1
> + Date: * (glob)
> + Author: * (glob)
> + Branch: HEAD
> + Tag: (none)
> + Branchpoints: v0
> + Log:
> + Initial revision
> +
> + Members:
> + a:INITIAL->1.1
> + b:INITIAL->1.1
> +
> + ---------------------
> + PatchSet 2
> + Date: * (glob)
> + Author: * (glob)
> + Branch: v0
> + Tag: r0
> + Log:
> + init
> +
> + Members:
> + a:1.1->1.1.1.1
> + b:1.1->1.1.1.1
> +
> + ---------------------
> + PatchSet 3
> + Date: * (glob)
> + Author: * (glob)
> + Branch: HEAD
> + Tag: (none)
> + Log:
> + update
> +
> + Members:
> + a:1.1->1.2
> + b:1.1->1.2(DEAD)
> +
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel
More information about the Mercurial-devel
mailing list