Skip to content

Instantly share code, notes, and snippets.

@mcbrwr
Last active July 8, 2024 09:26
Show Gist options
  • Select an option

  • Save mcbrwr/4e04cee615bd954476cd to your computer and use it in GitHub Desktop.

Select an option

Save mcbrwr/4e04cee615bd954476cd to your computer and use it in GitHub Desktop.
fix for "svn pristine text not present" error in a working copy
#!/bin/bash
# for an "svn pristine text not present" error like this:
# svn: E155010: Pristine text 'd6612ee6af5d9fb4459cbe7e2e8e18f7fb4201f8' not present
# you can delete the file and retrieve it with svn up
# (if you have local modifications, make up your own plan)
# -
# Run this script from the root of the working copy.
# It retrieves the file that's causing the error from wc.db
# usage example : ./svn-pristine-find.sh d6612ee6af5d9fb4459cbe7e2e8e18f7fb4201f8
SHA1="$1"
set -e
FILE=$(sqlite3 .svn/wc.db 'select local_relpath from nodes where checksum="$sha1$'$SHA1'"')
echo "File causing trouble is: $FILE";
@panbotoy

Copy link
Copy Markdown

It helps! Thanks!

@tonyvu2014

Copy link
Copy Markdown

It worked. Thanks.

@remi-bruguier

Copy link
Copy Markdown

Working indeed, Thanks !

@gklimm

gklimm commented May 1, 2015

Copy link
Copy Markdown

Good Job! Thanks!

@sidthesloth92

Copy link
Copy Markdown

Thanks, it worked.. :)

@butaca

butaca commented Jul 17, 2015

Copy link
Copy Markdown

Thanks! 😄

@GibStorm

GibStorm commented Feb 2, 2016

Copy link
Copy Markdown

The script gives me the problematic file just fine, but doing the svn update after deleting the file simply repeats the error message. What to do?

@OnurVar

OnurVar commented Mar 3, 2016

Copy link
Copy Markdown

It helps. Thanks!

@pmahend1

Copy link
Copy Markdown

Not working for me.

@zhuweiyou

Copy link
Copy Markdown

Thanks

@sizemax

sizemax commented Jan 1, 2020

Copy link
Copy Markdown

Thanks, it worked... :D

@egalot

egalot commented Feb 13, 2020

Copy link
Copy Markdown

Same problem as GibStorm. Upon restoring the problematic file the problem returns.

@tinyzoo

tinyzoo commented Aug 7, 2020

Copy link
Copy Markdown

I am also having the same problem. I run the script, but when I try to run Cleanup, I get the same error.

@daniel-schmidt

Copy link
Copy Markdown

I also had the same problem as GibStorm. What actually worked for me, is desribed here: https://www.tutorialfor.com/questions-102014.htm

So after you found the offending file you can update it to revision 0 by doing svn up -r0 File.txt and afterwards perform a normal svn up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment