Fossil SCM

Simplifications to the SQL that determines a fork to merge when the "fossil merge" command has no VERSION argument.

drh 2013-01-14 01:53 trunk
Commit 8a470fd4bca8a81c67503bc0aba61a932c4de4ef
1 file changed +4 -9
+4 -9
--- src/merge.c
+++ src/merge.c
@@ -173,26 +173,21 @@
173173
" AND NOT EXISTS(SELECT 1 FROM tagxref" /* Constraint (3) */
174174
" WHERE rid=leaf.rid"
175175
" AND tagid=%d"
176176
" AND tagtype>0)"
177177
" AND (SELECT value FROM tagxref" /* Constraint (4) */
178
- " WHERE tagid=%d AND rid=%d"
179
- " AND tagtype>0"
180
- " ORDER BY mtime DESC LIMIT 1) = "
178
+ " WHERE tagid=%d AND rid=%d AND tagtype>0) ="
181179
" (SELECT value FROM tagxref"
182
- " WHERE tagid=%d AND rid=leaf.rid"
183
- " AND tagtype>0"
184
- " ORDER BY mtime DESC LIMIT 1)"
180
+ " WHERE tagid=%d AND rid=leaf.rid AND tagtype>0)"
185181
" ORDER BY event.mtime DESC LIMIT 1",
186182
vid, TAG_CLOSED, TAG_BRANCH, vid, TAG_BRANCH
187183
);
188184
if( mid==0 ){
189185
fossil_fatal("no unmerged forks of branch \"%s\"",
190186
db_text(0, "SELECT value FROM tagxref"
191
- " WHERE tagid=%d AND rid=%d"
192
- " AND tagtype>0"
193
- " ORDER BY mtime DESC LIMIT 1", TAG_BRANCH, vid)
187
+ " WHERE tagid=%d AND rid=%d AND tagtype>0",
188
+ TAG_BRANCH, vid)
194189
);
195190
}
196191
db_prepare(&q,
197192
"SELECT blob.uuid,"
198193
" datetime(event.mtime,'localtime'),"
199194
--- src/merge.c
+++ src/merge.c
@@ -173,26 +173,21 @@
173 " AND NOT EXISTS(SELECT 1 FROM tagxref" /* Constraint (3) */
174 " WHERE rid=leaf.rid"
175 " AND tagid=%d"
176 " AND tagtype>0)"
177 " AND (SELECT value FROM tagxref" /* Constraint (4) */
178 " WHERE tagid=%d AND rid=%d"
179 " AND tagtype>0"
180 " ORDER BY mtime DESC LIMIT 1) = "
181 " (SELECT value FROM tagxref"
182 " WHERE tagid=%d AND rid=leaf.rid"
183 " AND tagtype>0"
184 " ORDER BY mtime DESC LIMIT 1)"
185 " ORDER BY event.mtime DESC LIMIT 1",
186 vid, TAG_CLOSED, TAG_BRANCH, vid, TAG_BRANCH
187 );
188 if( mid==0 ){
189 fossil_fatal("no unmerged forks of branch \"%s\"",
190 db_text(0, "SELECT value FROM tagxref"
191 " WHERE tagid=%d AND rid=%d"
192 " AND tagtype>0"
193 " ORDER BY mtime DESC LIMIT 1", TAG_BRANCH, vid)
194 );
195 }
196 db_prepare(&q,
197 "SELECT blob.uuid,"
198 " datetime(event.mtime,'localtime'),"
199
--- src/merge.c
+++ src/merge.c
@@ -173,26 +173,21 @@
173 " AND NOT EXISTS(SELECT 1 FROM tagxref" /* Constraint (3) */
174 " WHERE rid=leaf.rid"
175 " AND tagid=%d"
176 " AND tagtype>0)"
177 " AND (SELECT value FROM tagxref" /* Constraint (4) */
178 " WHERE tagid=%d AND rid=%d AND tagtype>0) ="
 
 
179 " (SELECT value FROM tagxref"
180 " WHERE tagid=%d AND rid=leaf.rid AND tagtype>0)"
 
 
181 " ORDER BY event.mtime DESC LIMIT 1",
182 vid, TAG_CLOSED, TAG_BRANCH, vid, TAG_BRANCH
183 );
184 if( mid==0 ){
185 fossil_fatal("no unmerged forks of branch \"%s\"",
186 db_text(0, "SELECT value FROM tagxref"
187 " WHERE tagid=%d AND rid=%d AND tagtype>0",
188 TAG_BRANCH, vid)
 
189 );
190 }
191 db_prepare(&q,
192 "SELECT blob.uuid,"
193 " datetime(event.mtime,'localtime'),"
194

Keyboard Shortcuts

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