svn up creates conflicts

Hmmm, I thought with my recent changes to use ‘svn up -r XXX’ would solve the problem of repo-copies.

Why are repo-copies a problem for FreshPorts? FreshPorts knows only about the files mentioned in a commit. With repo-copies, a whole directory is moved, but the files in that directory are not mentioned in the commit.

Doing an svn up on the directory in question *should* solve this issue.

But it didn’t. This commit which moved www/moodle2 to www/moodle22, but FreshPorts failed to populate the www/moodle22 directory before attempting to extract values from the new port.

[dan@ngaio:~/PORTS-SVN] $ ls -l www/moodle2 www/moodle22
www/moodle2:
total 10
-rw-r--r--  1 dan  dan  2714 Aug  9 02:34 Makefile
-rw-r--r--  1 dan  dan   128 Aug  9 02:34 distinfo
drwxr-xr-x  2 dan  dan   512 Aug  8 11:59 files
-rw-r--r--  1 dan  dan   364 Aug  8 11:59 pkg-descr

www/moodle22:
total 0
[dan@ngaio:~/PORTS-SVN] $

Let’s look at the processing for this commit.

First, what’s in the XML file, are the right directories listed? Here’s an extract:

<FILES>
  <FILE Revision="302321" Action="Add" Path="ports/www/moodle22/"></FILE>
  <FILE Revision="302321" Action="Modify" Path="ports/www/Makefile"></FILE>
  <FILE Revision="302321" Action="Modify" Path="ports/www/moodle2/Makefile"></FILE>
  <FILE Revision="302321" Action="Modify" Path="ports/www/moodle2/distinfo"></FILE>
  <FILE Revision="302321" Action="Modify" Path="ports/www/moodle22/Makefile"></FILE>
</FILES>

Yes, that’s the same files listed in the original commit. Now it’s time to look into the debug logs.

Here is the refresh of the new directory…

$ svn up -r 302321 /wdc/dan/PORTS-SVN/www/moodle22/
Updating '/wdc/dan/PORTS-SVN/www/moodle22':
   C /wdc/dan/PORTS-SVN/www/moodle22
   A /wdc/dan/PORTS-SVN/www/moodle22/distinfo
   A /wdc/dan/PORTS-SVN/www/moodle22/pkg-descr
   A /wdc/dan/PORTS-SVN/www/moodle22/files
   A /wdc/dan/PORTS-SVN/www/moodle22/files/pkg-message.in
   A /wdc/dan/PORTS-SVN/www/moodle22/Makefile
Updated to revision 302321.
Summary of conflicts:
  Tree conflicts: 1

See that conflict? That’s bad. Hmm. But why?

First, let’s get back to a known good position.

 $ svn up -r 302320
Updating '.':
Skipped 'www/moodle22' -- Node remains in conflict
At revision 302320.
Summary of conflicts:
  Skipped paths: 1
[dan@ngaio:~/PORTS-SVN] $ rm -rf www/moodle22
[dan@ngaio:~/PORTS-SVN] $ svn resolved www/moodle22
Resolved conflicted state of 'www/moodle22'
[dan@ngaio:~/PORTS-SVN] $ svn up www/moodle22
Updating 'www/moodle22':
At revision 302337.
[dan@ngaio:~/PORTS-SVN] $ ls -l www/moodle2 www/moodle22
ls: www/moodle22: No such file or directory
www/moodle2:
total 10
-rw-r--r--  1 dan  dan  2710 Aug  9 11:47 Makefile
-rw-r--r--  1 dan  dan   128 Aug  9 11:47 distinfo
drwxr-xr-x  2 dan  dan   512 Aug  8 11:59 files
-rw-r--r--  1 dan  dan   364 Aug  8 11:59 pkg-descr

OK, this seems to be a consistent SVN tree now. Let’s move to the revision associated with this commit:

$ svn up -r 302321
Updating '.':
U    www/moodle2/distinfo
U    www/moodle2/Makefile
U    www/Makefile
Updated to revision 302321.

But where is moodle22? Why didn’t it come in?

$ ls -l www/moodle2 www/moodle22
ls: www/moodle22: No such file or directory
www/moodle2:
total 10
-rw-r--r--  1 dan  dan  2714 Aug  9 11:50 Makefile
-rw-r--r--  1 dan  dan   128 Aug  9 11:50 distinfo
drwxr-xr-x  2 dan  dan   512 Aug  8 11:59 files
-rw-r--r--  1 dan  dan   364 Aug  8 11:59 pkg-descr

Then I did an ‘svn up’, but I have not shown that here. Then I looked at the status:

$ svn st
D       www/moodle22
D       www/moodle22/pkg-descr
D       www/moodle22/distinfo
D       www/moodle22/files
D       www/moodle22/files/pkg-message.in
D       www/moodle22/Makefile
?       ports

Eh? That’s… umm… interesting. Why and how did this arise? Let’s revert all this.

$ svn revert www/moodle22 www/moodle22/pkg-descr www/moodle22/distinfo www/moodle22/files www/moodle22/files/pkg-message.in www/moodle22/Makefile
Reverted 'www/moodle22'
Reverted 'www/moodle22/pkg-descr'
Reverted 'www/moodle22/distinfo'
Reverted 'www/moodle22/files'
Reverted 'www/moodle22/files/pkg-message.in'
Reverted 'www/moodle22/Makefile'
$ rmdir ports
$ svn st
$

OK. Now we should be in a consistent state, although not at the revision we want. Let’s go back to the revision just before that commit.

$ svn -r 302320
[output omitted from this blog post]
$ ls -l www/moodle2 www/moodle22
ls: www/moodle22: No such file or directory
www/moodle2:
total 10
-rw-r--r--  1 dan  dan  2710 Aug  9 12:14 Makefile
-rw-r--r--  1 dan  dan   128 Aug  9 12:14 distinfo
drwxr-xr-x  2 dan  dan   512 Aug  8 11:59 files
-rw-r--r--  1 dan  dan   364 Aug  8 11:59 pkg-descr

Good. As I expected. Now let’s try what the code did before…

$ svn up -r 302321 /wdc/dan/PORTS-SVN/www/moodle22/
Updating 'www/moodle22':
A    www/moodle22
A    www/moodle22/distinfo
A    www/moodle22/pkg-descr
A    www/moodle22/files
A    www/moodle22/files/pkg-message.in
A    www/moodle22/Makefile
Updated to revision 302321.
$ ls -l www/moodle2 www/moodle22
www/moodle2:
total 10
-rw-r--r--  1 dan  dan  2710 Aug  9 12:14 Makefile
-rw-r--r--  1 dan  dan   128 Aug  9 12:14 distinfo
drwxr-xr-x  2 dan  dan   512 Aug  8 11:59 files
-rw-r--r--  1 dan  dan   364 Aug  8 11:59 pkg-descr

www/moodle22:
total 10
-rw-r--r--  1 dan  dan  2710 Aug  9 12:15 Makefile
-rw-r--r--  1 dan  dan   128 Aug  9 12:15 distinfo
drwxr-xr-x  2 dan  dan   512 Aug  9 12:15 files
-rw-r--r--  1 dan  dan   364 Aug  9 12:15 pkg-descr
$

Umm, OK, so why does this work now, but now when FreshPorts did it?

Website Pin Facebook Twitter Myspace Friendfeed Technorati del.icio.us Digg Google StumbleUpon Premium Responsive

2 thoughts on “svn up creates conflicts”

  1. I think the solution was to do this:

    cd /wdc/dan/PORTS-SVN/
    svn up -r 302321 www/moodle22
    

    instead of

    svn up -r 302321 /wdc/dan/PORTS-SVN/www/moodle22/
    

    In the end, I wound up doing:

    cd /wdc/dan/PORTS-SVN
    svn up -r 302321
    

    An svn up of the entire tree can take a minute or so.

Leave a Comment

Scroll to Top