Skip to content

Instantly share code, notes, and snippets.

@carloscarcamo
Forked from mcbrwr/svn-pristine-find.sh
Last active August 29, 2015 14:07
Show Gist options
  • Save carloscarcamo/b1dea77ebf5071c845a6 to your computer and use it in GitHub Desktop.
Save carloscarcamo/b1dea77ebf5071c845a6 to your computer and use it in GitHub Desktop.
#!/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";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment