On Wed, Mar 28, 2012 at 4:27 PM, Bert Huijben <bert_at_qqmail.nl> wrote:
>
>
>> -----Original Message-----
>> From: Johan Corveleyn [mailto:jcorvel_at_gmail.com]
>> Sent: woensdag 28 maart 2012 15:47
>> To: Philip Martin
>> Cc: users_at_subversion.apache.org
>> Subject: Re: svn 1.7: how to recover from a lost pristine file
>>
>> On Wed, Mar 28, 2012 at 3:08 PM, Johan Corveleyn <jcorvel_at_gmail.com>
>> wrote:
>> > On Wed, Mar 28, 2012 at 2:12 PM, Philip Martin
>> > <philip.martin_at_wandisco.com> wrote:
>> >> Johan Corveleyn <jcorvel_at_gmail.com> writes:
>> >>
>> >>> For some reason, I lost a pristine file [*] in a 1.7 working copy. I'm
>> >>> trying to recover from this without having to throw away my entire
>> >>> working copy. So far I'm unsuccessful. Any help is appreciated.
>> >>>
>> >>> svn-1.7 is SlikSVN 1.7.4 (On Windows 7, 64bit):
>> >>> [[[
>> >>> C:\Work\WC-root>svn-1.7 update -r0 the\file\with\missing\pristine.java
>> >>> svn: E155037: Previous operation has not finished; run 'cleanup' if it
>> >>> was interrupted
>> >>>
>> >>> C:\Work\WC-root>svn-1.7 cleanup the\file\with\missing
>> >>> svn: E155004: Working copy 'C:\Work\WC-root\the\file\with\missing'
>> locked.
>> >>> svn: E155004: 'C:\Work\WC-root' is already locked.
>> >>> svn: E155037: Previous operation has not finished; run 'cleanup' if it
>> >>> was interrupted
>> >>> svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for
> details)
>> >>>
>> >>> C:\Work\WC-root>svn-1.7 cleanup
>> >>> svn: E720002: Can't open file
>> >>> 'C:\Work\WC-
>> root\.svn\pristine\6d\6d6e0892990e945b03a15b8e518dbef26848dc75.svn-
>> base':
>> >>> The system cannot find the file specified.
>> >>> ]]]
>> >>>
>> >>> (the fact that the working copy is locked to begin with, was because a
>> >>> normal 'svn update' failed because of the missing pristine, with "svn:
>> >>> E155004: There are unfinished work items in 'C:\Work\WC-root'; run
>> >>> 'svn cleanup' first.", which is why I first found out about the
>> >>> problem)
>> >>>
>> >>> Anything I can do to investigate further?
>> >>
>> >> Use the sqlite3 utility
>> >>
>> >> sqlite3 .svn/wc.db "select * from work_queue"
>> >
>> > Thanks for your help, Philip.
>> >
>> > $ sqlite3 .svn/wc.db "select * from work_queue"
>> > 1|(file-install trunk/rootdir/the/file/with/missing/pristine.java 1 0 1
> 1)
>> >
>> >> These may show something:
>> >>
>> >> sqlite3 wc/.svn/wc.db "select * from nodes where local_relpath =
>> '/the/file/with/missing/pristine.java'"
>> >>
>> >> sqlite3 wc/.svn/wc.db "select * from nodes where checksum like
>> '%6d6e0892990e945b03a15b8e518dbef26848dc75'"
>> >
>> > Both of the above show the same:
>> >
>>
> 1|the/file/with/missing/pristine.java|0|the/file/with/missing|1|trunk/rootdi
> r/t
>> he/file/with/missing/pristine.java|176219|normal|||file|(svn:eol-style
>> >
>> native)||$sha1$6d6e0892990e945b03a15b8e518dbef26848dc75||175563|1332
>> 375850493000|username|56722|1332709446087164||
>> >
>> >> sqlite3 wc/.svn/wc.db "select * from pristine where checksum like
>> '%6d6e0892990e945b03a15b8e518dbef26848dc75'"
>> >
>> > That shows nothing.
>> >
>> >> Depending on what the work_queue shows you may be able to further
>> >> corrupt your working copy and then recover by doing this:
>> >>
>> >> sqlite .svn/wc.db "delete from work_queue"
>> >> svn up -r0 file
>> >>
>> >> IMPORTANT! Deleting the work_queue does generally make the working
>> copy
>> >> invalid, it is then up to you to ensure it returns to a valid state.
>>
>> Hm, no luck:
>>
>> [[[
>> $ sqlite3 .svn/wc.db "delete from work_queue"
>>
>> $ sqlite3 .svn/wc.db "select * from work_queue"
>> <nothing>
>>
>> C:\Work\WC-root>svn-1.7 up -r0 the/file/with/missing/pristine.java
>> svn: E155004: Working copy 'C:\Work\WC-root\the\file\with\missing' locked.
>> svn: E155004: 'C:\Work\WC-root' is already locked.
>> svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for
> details)
>>
>> C:\Work\WC-root>svn-1.7 cleanup
>>
>> <yay! this time 'svn cleanup' completes, let's try again>
>>
>> C:\Work\WC-root>svn-1.7 up -r0 the/file/with/missing/pristine.java
>> Updating 'the\file\with\missing\pristine.java':
>> svn: E720002: Can't open file
>> 'C:\Work\WC-
>> root\.svn\pristine\6d\6d6e0892990e945b03a15b8e518dbef26848dc75.svn-
>> base':
>> The system cannot find the file specified.
>>
>> <at this point, a work-queue item has been created again>
>>
>> $ sqlite3 .svn/wc.db "select * from work_queue"
>> 2|(file-install the/file/with/missing/pristine.java 1 0 1 1)
>>
>> ]]]
>>
>> Any other suggestions?
>
> Maybe 'svn up --set-depth exclude X' instead of -r0.
> And then a 'svn up X'
Cool! That actually worked. Well, after I cleared the work_queue again
first, and ran cleanup. So the full recovery sequence was:
$ sqlite3 .svn/wc.db "delete from work_queue"
$ svn cleanup
$ svn up --set-depth exclude X
$ svn up X
Thanks both for your help. Maybe this will help others running in the
same situation ...
--
Johan
Received on 2012-03-28 16:39:35 CEST