SvnHelp >

  1. Set up and optimize SVN to access the GCC repository.

  2. A conceptual introduction to SVN for CVS users.

  3. SVN Basic commands.

  4. Moving patches around: merging and backporting.

  5. How to maintain a branch.

  6. Various tricks and recipes.

  7. Troubleshooting.

Troubleshooting

If the problem is due to inconsistent or incorrect documentation elsewhere in the Wiki, fix it there! If it is just something that you did that now looks dumb, but took you a while to figure out, here is the place for it.

$ svn merge ...
$ svn revert -R .

doesn't revert the file adds that are performed by the merge. When doing a really tiny merge, say with 1 file, this is ok, in real software, this sucks hard. Now, why does this matter, because if you re-run the merge after reverting it, it will not merge it again:

Skipped 'gcc/testsuite/gcc.c-torture/execute/4233898.c'

If you do a svn status and remove all the '^?' files it will be closer.

$ svn merge ...
$ svn revert -R .

can randomly fail retrying to revert a merge:

Reverted 'libgfortran/generated/fraction_r16.c'
svn: Error restoring text for 'libgfortran/generated/_sqrt_c8.f90'
svn: Can't copy 'libgfortran/generated/.svn/text-base/_sqrt_c8.f90.svn-base' to 'libgfortran/generated/_sqrt_c8.f90.tmp': No such file or directory

$ svn merge

can create a file that is then out of date, thus preventing checkins, when the file has been replaced, but was otherwise up-to-date. An example of this in the gcc reproistory is trunk/gcc/ada/system-linux-sparc.ads when merging from tags/gcc_4_0_1_release to trunk@101729. svn status -u gives:

$ svn status -u system-linux-sparc.ads
R  +   *        -   system-linux-sparc.ads

with no known to me way to clear to * flag. The usual method to clear that flag would be:

$ svn up system-linux-sparc.ads
svn: Failed to add file 'system-linux-sparc.ads': object of the same name already exists

additionally, trying to force things:

$ svn mv  system-linux-sparc.ads system-linux-sparc.ads.SAVE
svn: Use --force to override this restriction
svn: Move will not be attempted unless forced
svn: 'system-linux-sparc.ads' has local modifications
$ svn mv --force  system-linux-sparc.ads system-linux-sparc.ads.SAVE
svn: Cannot copy or move 'system-linux-sparc.ads': it's not in the repository yet; try committing first

doesn't work either. :-( This can be fixed by reverting the directory that contained the file, cleaning up any added files, merging the file in question first, then merging the directory again.

$ svn status -u . | grep '^R......\*'

was going to be a way to pre-identify all the files in question before checkin, but unfortunately it stops upon the first file that is so conflicted and gives:

$ svn status -u . | grep '^R......\*'
svn: Working copy path 'libstdc++-v3/src/compatibility.cc' does not exist in repository
$ svn status -u libstdc++-v3/src/compatibility.cc | grep '^R......\*'
R  +   *        -   libstdc++-v3/src/compatibility.cc

totally violating the idea that the command will actually give status information about all the files. svn should continue, not bail upon the first `unexpected' thing. Anyway, an automated way to fixup all of these issues would be:

$ fixup() { svn="svn+ssh://src.apple.com/svn/fsf-gcc/gcc/"
   base="tags/gcc_4_0_1_release"
   new="trunk"
   newrev="@101729"
   cksum "$1" &&
   svn revert "$1" &&
   svn rm "$1" &&
   svn up "$1" &&
   svn merge "$svn/$base/$1" "$svn/$new/$1$newrev" "$1" &&
   cksum "$1"; }
$ svn status . | grep '^R' | cut -c8- | while read f; do echo "$f"; fixup "$f";done

$ svn merge

can bail out in the middle of a merge with:

  svn: Working copy 'libstdc++-v3/testsuite/tr1/6_containers/unordered' is missing or not locked

which is really annoying if this happens in the middle of a multi-stage merge operation when you've done a few merges and spent hours resolving them, and you do a few more and start resolving them, and when you get to the bottom of the last, it was incomplete, thus leaving one wondering how to not blow the merge and not have to revert all of the merges and waste all the hours of work already invested. I want svn merge to not bail in the middle, but keep going, all the funny bits I want files with conflicts in them. For really funny things (file <-> dir collisions), I'd want foo and foo-file with the conflicts.

None: SvnProblems (last edited 2008-08-26 09:44:33 by ManuelLopezIbanez)