[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: inconsistent revision numbers

From: Stefan Sperling <stsp_at_apache.org>
Date: Mon, 30 Oct 2017 15:30:54 +0100

On Mon, Oct 30, 2017 at 03:11:20PM +0100, Branko Čibej wrote:
> On 30.10.2017 14:54, Norbert Preining wrote:
> > Dear all,
> >
> > (please Cc, I am not subscribed)
> >
> > I have blogged about this [1] and both Branko Čibej and Stefan Sperling
> > asked me to move the discussion here.
> > [1] https://www.preining.info/blog/2017/10/inconsistent-version-numbers-in-subversion/
> >
> > I describe my problem
> >
> > * Assume a subversion server and two checkouts
> > * both checkout are completely clean, no out-of-vcs files, no
> > ignored files, no mixed revisions, dead plain svn checkouts.
>
> I'm pretty sure they're not, but see below.
>
> > * Furthermore, assume the following set of commits:
> >
> > revision A: file xxx is changed
> > revision A+n: file xxx is changed again
> > revision A+n+m: file xxx is changed and takes the same content
> > as back in revision A
> >
> > Assume two users:
> > User A did 'svn up' between revision A+n and A+n+m
> > User B did 'svn up' in [A, A+n), but NOT in [A+n, A+n+m), and
> > again after A+n+m
> >
> >
> > In this case, the "last comitted revision" (according to 'svn status -v')
> > differ:
> > User A will get A+n+m
> > User B will get A
> >
> > In practice, in our TeX Live main repository, when I do 'svn status -v'
> > in my own checkout, I see:
> > 45627 39121 karl Master/tlpkg/tlpsrc/collection-langgreek.tlpsrc
> > and when I do it on our master checkout (the one that does the daily
> > updates for TeX Live) I see:
> > 45643 44192 karl Master/tlpkg/tlpsrc/collection-langgreek.tlpsrc
> > (empty initial columns deleted).
> >
> > The second number here is -- according to 'svn status -h' --
> > The last committed revision and last committed author (with -v)
> > ^^^^^^^^^^^^^^^^^^^^^^^
> >
> > My assumption *was* that this is *consistent* across checkout, but it is
> > not.
>
> It should be.
>
> I took a look at the TeXlive repository, specifically at that file. In
> both cases, wheather the working copy revision (svn update -r X) is
> 45627 or 45643, that file's last changed revision should be 44192.
>
> Here's the proof:
>
> $ svn info --show-item=last-changed-revision svn://tug.org/texlive/trunk/Master/tlpkg/tlpsrc/collection-langgreek.tlpsrc
> 44192
>
> $ svn info --show-item=last-changed-revision svn://tug.org/texlive/trunk/Master/tlpkg/tlpsrc/collection-langgreek.tlpsrc_at_45627
> 44192
>
>
>
> > Is this an intended behavior?
>
> That depends on what you did. :)
>
> For example, what does `svnversion` say about your working copy?
> Compared to the master?
>
> Unless this is a strange artefact of git-svn, I'd recommend an "svn
> update" in your working copy ("your checkout," as you call it) and let's
> see what happens.
>
> -- Brane
>

It looks like a bug. The last-changed revision of the file is not
bumped even though it should be. It seems to be related to the
fact that the server does not send a delta for the file during
client B's update because the file's content is the same.

I can reproduce the problem with the attached script.
Below is the full output.

Note that the file 'alpha' is last-changed in revision 4 but has
an incorrect last-changed revision of r2 instead of r4:

                 4 2 stsp last-changed-rev/trunkB/alpha

The output changes if this line in the script:

echo change1 > $trunk/alpha # change back to content of r2

is changed to:

echo change3 > $trunk/alpha # change to other content

which results in a non-null delta on user B's update.

                 4 4 stsp last-changed-rev/trunkB/alpha

+ set -e
+ pwd
+ cwd=/tmp
+ basename last-changed-rev.sh .sh
+ scratch_area=last-changed-rev
+ repos=last-changed-rev/repos
+ trunk=last-changed-rev/trunk
+ branch=last-changed-rev/branch
+ trunk_url=file:////tmp/last-changed-rev/repos/trunk
+ branch_url=file:////tmp/last-changed-rev/repos/branch
+ set -x
+ rm -rf last-changed-rev
+ mkdir -p last-changed-rev
+ mkdir -p last-changed-rev/trunk
+ echo alpha
+ > last-changed-rev/trunk/alpha
+ svnadmin create /tmp/last-changed-rev/repos
+ svn import last-changed-rev/trunk file:////tmp/last-changed-rev/repos/trunk -m importing project tree
Adding last-changed-rev/trunk/alpha
Committing transaction...
Committed revision 1.
+ rm -rf last-changed-rev/trunk
+ svn checkout file:////tmp/last-changed-rev/repos/trunk last-changed-rev/trunk
A last-changed-rev/trunk/alpha
Checked out revision 1.
+ svn checkout file:////tmp/last-changed-rev/repos/trunk last-changed-rev/trunkA
A last-changed-rev/trunkA/alpha
Checked out revision 1.
+ svn checkout file:////tmp/last-changed-rev/repos/trunk last-changed-rev/trunkB
A last-changed-rev/trunkB/alpha
Checked out revision 1.
+ echo change1
+ > last-changed-rev/trunk/alpha
+ svn ci last-changed-rev/trunk -m revision A: file xxx is changed
Sending last-changed-rev/trunk/alpha
Transmitting file data .done
Committing transaction...
Committed revision 2.
+ svn up last-changed-rev/trunkB
Updating 'last-changed-rev/trunkB':
U last-changed-rev/trunkB/alpha
Updated to revision 2.
+ echo change2
+ > last-changed-rev/trunk/alpha
+ svn ci last-changed-rev/trunk -m revision A+n: file xxx is changed again
Sending last-changed-rev/trunk/alpha
Transmitting file data .done
Committing transaction...
Committed revision 3.
+ svn up last-changed-rev/trunkA
Updating 'last-changed-rev/trunkA':
U last-changed-rev/trunkA/alpha
Updated to revision 3.
+ echo change1
+ > last-changed-rev/trunk/alpha
+ svn ci last-changed-rev/trunk -m revision A+n+m: file xxx is changed and takes the same content as back in revision A
Sending last-changed-rev/trunk/alpha
Transmitting file data .done
Committing transaction...
Committed revision 4.
+ svn up last-changed-rev/trunkB
Updating 'last-changed-rev/trunkB':
At revision 4.
+ svn status -v last-changed-rev/trunkA
                 3 3 stsp last-changed-rev/trunkA
                 3 3 stsp last-changed-rev/trunkA/alpha
+ svn status -v last-changed-rev/trunkB
                 4 4 stsp last-changed-rev/trunkB
                 4 2 stsp last-changed-rev/trunkB/alpha

Received on 2017-10-30 15:31:32 CET

This is an archived mail posted to the Subversion Users mailing list.