Fossil SCM

Fix bug detected by wiki-15 and wiki-15.1. Left hand thought that the mtime column was the timestamp of the tech note. Right hand thought that the mtime column was the last modification time of the tech note. Left hand was right and the relevant query has been updated to use the objid (assigned as the new tech note manifest is added) as the indication of the most recently modified version of the tech note

dave.vines 2016-05-05 18:26
Commit e9d7c5aa29c3fca8ac29f6faa050df48a62ae7a0
1 file changed +4 -3
+4 -3
--- src/wiki.c
+++ src/wiki.c
@@ -1152,11 +1152,11 @@
11521152
rid = db_int(0, "SELECT objid"
11531153
" FROM event"
11541154
" WHERE datetime(mtime)=datetime('%q')"
11551155
" AND type='e'"
11561156
" AND tagid IS NOT NULL"
1157
- " ORDER BY mtime DESC LIMIT 1",
1157
+ " ORDER BY objid DESC LIMIT 1",
11581158
zETime);
11591159
}
11601160
}
11611161
return rid;
11621162
}
@@ -1191,12 +1191,13 @@
11911191
** the previous version of the
11921192
** page, or text/x-fossil-wiki.
11931193
** -t|--technote DATETIME Specifies the timestamp of
11941194
** the technote to be created or
11951195
** updated. When updating a tech note
1196
-** the most recently modified with the
1197
-** specified timestamp will be updated.
1196
+** the most recently modified tech note
1197
+** with the specified timestamp will be
1198
+** updated.
11981199
** -t|--technote TECHNOTE-ID Specifies the technote to be
11991200
** updated by its technote id.
12001201
** --technote-tags TAGS The set of tags for a technote.
12011202
** --technote-bgcolor COLOR The color used for the technote
12021203
** on the timeline.
12031204
--- src/wiki.c
+++ src/wiki.c
@@ -1152,11 +1152,11 @@
1152 rid = db_int(0, "SELECT objid"
1153 " FROM event"
1154 " WHERE datetime(mtime)=datetime('%q')"
1155 " AND type='e'"
1156 " AND tagid IS NOT NULL"
1157 " ORDER BY mtime DESC LIMIT 1",
1158 zETime);
1159 }
1160 }
1161 return rid;
1162 }
@@ -1191,12 +1191,13 @@
1191 ** the previous version of the
1192 ** page, or text/x-fossil-wiki.
1193 ** -t|--technote DATETIME Specifies the timestamp of
1194 ** the technote to be created or
1195 ** updated. When updating a tech note
1196 ** the most recently modified with the
1197 ** specified timestamp will be updated.
 
1198 ** -t|--technote TECHNOTE-ID Specifies the technote to be
1199 ** updated by its technote id.
1200 ** --technote-tags TAGS The set of tags for a technote.
1201 ** --technote-bgcolor COLOR The color used for the technote
1202 ** on the timeline.
1203
--- src/wiki.c
+++ src/wiki.c
@@ -1152,11 +1152,11 @@
1152 rid = db_int(0, "SELECT objid"
1153 " FROM event"
1154 " WHERE datetime(mtime)=datetime('%q')"
1155 " AND type='e'"
1156 " AND tagid IS NOT NULL"
1157 " ORDER BY objid DESC LIMIT 1",
1158 zETime);
1159 }
1160 }
1161 return rid;
1162 }
@@ -1191,12 +1191,13 @@
1191 ** the previous version of the
1192 ** page, or text/x-fossil-wiki.
1193 ** -t|--technote DATETIME Specifies the timestamp of
1194 ** the technote to be created or
1195 ** updated. When updating a tech note
1196 ** the most recently modified tech note
1197 ** with the specified timestamp will be
1198 ** updated.
1199 ** -t|--technote TECHNOTE-ID Specifies the technote to be
1200 ** updated by its technote id.
1201 ** --technote-tags TAGS The set of tags for a technote.
1202 ** --technote-bgcolor COLOR The color used for the technote
1203 ** on the timeline.
1204

Keyboard Shortcuts

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