Fossil SCM

Make sure that the UUID of a generated P-card is the UUID of a valid check-in in this repository. If not, bail out early.

jan.nijtmans 2013-10-09 09:20 trunk
Commit d30abe150a2ffd868bcae883a9fc466b2ad05be6
1 file changed +4 -2
+4 -2
--- src/checkin.c
+++ src/checkin.c
@@ -987,13 +987,15 @@
987987
const char *zColor; /* Modified value of p->zColor */
988988
989989
assert( pBaseline==0 || pBaseline->zBaseline==0 );
990990
assert( pBaseline==0 || zBaselineUuid!=0 );
991991
blob_zero(pOut);
992
- zParentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", vid);
992
+ zParentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d AND "
993
+ "EXISTS(SELECT 1 FROM event WHERE event.type='ci' and event.objid=%d)",
994
+ vid, vid);
993995
if( !zParentUuid ){
994
- fossil_fatal("Could not find manifest for RID %d. "
996
+ fossil_fatal("Could not find a valid check-in for RID %d. "
995997
"Possible checkout/repo mismatch.", vid);
996998
}
997999
if( pBaseline ){
9981000
blob_appendf(pOut, "B %s\n", zBaselineUuid);
9991001
manifest_file_rewind(pBaseline);
10001002
--- src/checkin.c
+++ src/checkin.c
@@ -987,13 +987,15 @@
987 const char *zColor; /* Modified value of p->zColor */
988
989 assert( pBaseline==0 || pBaseline->zBaseline==0 );
990 assert( pBaseline==0 || zBaselineUuid!=0 );
991 blob_zero(pOut);
992 zParentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", vid);
 
 
993 if( !zParentUuid ){
994 fossil_fatal("Could not find manifest for RID %d. "
995 "Possible checkout/repo mismatch.", vid);
996 }
997 if( pBaseline ){
998 blob_appendf(pOut, "B %s\n", zBaselineUuid);
999 manifest_file_rewind(pBaseline);
1000
--- src/checkin.c
+++ src/checkin.c
@@ -987,13 +987,15 @@
987 const char *zColor; /* Modified value of p->zColor */
988
989 assert( pBaseline==0 || pBaseline->zBaseline==0 );
990 assert( pBaseline==0 || zBaselineUuid!=0 );
991 blob_zero(pOut);
992 zParentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d AND "
993 "EXISTS(SELECT 1 FROM event WHERE event.type='ci' and event.objid=%d)",
994 vid, vid);
995 if( !zParentUuid ){
996 fossil_fatal("Could not find a valid check-in for RID %d. "
997 "Possible checkout/repo mismatch.", vid);
998 }
999 if( pBaseline ){
1000 blob_appendf(pOut, "B %s\n", zBaselineUuid);
1001 manifest_file_rewind(pBaseline);
1002

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button