Fossil SCM

Integrate andygoth-metadata-changes.

andygoth 2015-05-17 00:58 trunk merge
Commit dca018c447dc32fa3c05316ce0ffdde76d1968ba
+28 -1
--- src/checkin.c
+++ src/checkin.c
@@ -113,10 +113,18 @@
113113
blob_appendf(report, "ADDED_BY_MERGE %s\n", zDisplayName);
114114
}else if( isChnged==4 ){
115115
blob_appendf(report, "UPDATED_BY_INTEGRATE %s\n", zDisplayName);
116116
}else if( isChnged==5 ){
117117
blob_appendf(report, "ADDED_BY_INTEGRATE %s\n", zDisplayName);
118
+ }else if( isChnged==6 ){
119
+ blob_appendf(report, "EXECUTABLE %s\n", zDisplayName);
120
+ }else if( isChnged==7 ){
121
+ blob_appendf(report, "SYMLINK %s\n", zDisplayName);
122
+ }else if( isChnged==8 ){
123
+ blob_appendf(report, "UNEXEC %s\n", zDisplayName);
124
+ }else if( isChnged==9 ){
125
+ blob_appendf(report, "UNLINK %s\n", zDisplayName);
118126
}else if( file_contains_merge_marker(zFullName) ){
119127
blob_appendf(report, "CONFLICT %s\n", zDisplayName);
120128
}else{
121129
blob_appendf(report, "EDITED %s\n", zDisplayName);
122130
}
@@ -1633,10 +1641,12 @@
16331641
int dryRunFlag; /* True for a test run. Debugging only */
16341642
CheckinInfo sCiInfo; /* Information about this check-in */
16351643
const char *zComFile; /* Read commit message from this file */
16361644
int nTag = 0; /* Number of --tag arguments */
16371645
const char *zTag; /* A single --tag argument */
1646
+ ManifestFile *pFile; /* File structure in the manifest */
1647
+ Manifest *pManifest; /* Manifest structure */
16381648
Blob manifest; /* Manifest in baseline form */
16391649
Blob muuid; /* Manifest uuid */
16401650
Blob cksum1, cksum2; /* Before and after commit checksums */
16411651
Blob cksum1b; /* Checksum recorded in the manifest */
16421652
int szD; /* Size of the delta manifest */
@@ -2070,11 +2080,10 @@
20702080
blob_write_to_file(&muuid, zManifestFile);
20712081
free(zManifestFile);
20722082
blob_reset(&muuid);
20732083
}
20742084
2075
-
20762085
/* Update the vfile and vmerge tables */
20772086
db_multi_exec(
20782087
"DELETE FROM vfile WHERE (vid!=%d OR deleted) AND is_selected(id);"
20792088
"DELETE FROM vmerge;"
20802089
"UPDATE vfile SET vid=%d;"
@@ -2081,10 +2090,28 @@
20812090
"UPDATE vfile SET rid=mrid, chnged=0, deleted=0, origname=NULL"
20822091
" WHERE is_selected(id);"
20832092
, vid, nvid
20842093
);
20852094
db_lset_int("checkout", nvid);
2095
+
2096
+ /* Update the isexe and islink columns of the vfile table */
2097
+ db_prepare(&q,
2098
+ "UPDATE vfile SET isexe=:exec, islink=:link"
2099
+ " WHERE vid=:vid AND pathname=:path AND (isexe!=:exec OR islink!=:link)"
2100
+ );
2101
+ db_bind_int(&q, ":vid", nvid);
2102
+ pManifest = manifest_get(nvid, CFTYPE_MANIFEST, 0);
2103
+ manifest_file_rewind(pManifest);
2104
+ while( (pFile = manifest_file_next(pManifest, 0)) ){
2105
+ db_bind_int(&q, ":exec", pFile->zPerm && strstr(pFile->zPerm, "x"));
2106
+ db_bind_int(&q, ":link", pFile->zPerm && strstr(pFile->zPerm, "l"));
2107
+ db_bind_text(&q, ":path", pFile->zName);
2108
+ db_step(&q);
2109
+ db_reset(&q);
2110
+ }
2111
+ db_finalize(&q);
2112
+ manifest_destroy(pManifest);
20862113
20872114
if( useCksum ){
20882115
/* Verify that the repository checksum matches the expected checksum
20892116
** calculated before the check-in started (and stored as the R record
20902117
** of the manifest file).
20912118
--- src/checkin.c
+++ src/checkin.c
@@ -113,10 +113,18 @@
113 blob_appendf(report, "ADDED_BY_MERGE %s\n", zDisplayName);
114 }else if( isChnged==4 ){
115 blob_appendf(report, "UPDATED_BY_INTEGRATE %s\n", zDisplayName);
116 }else if( isChnged==5 ){
117 blob_appendf(report, "ADDED_BY_INTEGRATE %s\n", zDisplayName);
 
 
 
 
 
 
 
 
118 }else if( file_contains_merge_marker(zFullName) ){
119 blob_appendf(report, "CONFLICT %s\n", zDisplayName);
120 }else{
121 blob_appendf(report, "EDITED %s\n", zDisplayName);
122 }
@@ -1633,10 +1641,12 @@
1633 int dryRunFlag; /* True for a test run. Debugging only */
1634 CheckinInfo sCiInfo; /* Information about this check-in */
1635 const char *zComFile; /* Read commit message from this file */
1636 int nTag = 0; /* Number of --tag arguments */
1637 const char *zTag; /* A single --tag argument */
 
 
1638 Blob manifest; /* Manifest in baseline form */
1639 Blob muuid; /* Manifest uuid */
1640 Blob cksum1, cksum2; /* Before and after commit checksums */
1641 Blob cksum1b; /* Checksum recorded in the manifest */
1642 int szD; /* Size of the delta manifest */
@@ -2070,11 +2080,10 @@
2070 blob_write_to_file(&muuid, zManifestFile);
2071 free(zManifestFile);
2072 blob_reset(&muuid);
2073 }
2074
2075
2076 /* Update the vfile and vmerge tables */
2077 db_multi_exec(
2078 "DELETE FROM vfile WHERE (vid!=%d OR deleted) AND is_selected(id);"
2079 "DELETE FROM vmerge;"
2080 "UPDATE vfile SET vid=%d;"
@@ -2081,10 +2090,28 @@
2081 "UPDATE vfile SET rid=mrid, chnged=0, deleted=0, origname=NULL"
2082 " WHERE is_selected(id);"
2083 , vid, nvid
2084 );
2085 db_lset_int("checkout", nvid);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2086
2087 if( useCksum ){
2088 /* Verify that the repository checksum matches the expected checksum
2089 ** calculated before the check-in started (and stored as the R record
2090 ** of the manifest file).
2091
--- src/checkin.c
+++ src/checkin.c
@@ -113,10 +113,18 @@
113 blob_appendf(report, "ADDED_BY_MERGE %s\n", zDisplayName);
114 }else if( isChnged==4 ){
115 blob_appendf(report, "UPDATED_BY_INTEGRATE %s\n", zDisplayName);
116 }else if( isChnged==5 ){
117 blob_appendf(report, "ADDED_BY_INTEGRATE %s\n", zDisplayName);
118 }else if( isChnged==6 ){
119 blob_appendf(report, "EXECUTABLE %s\n", zDisplayName);
120 }else if( isChnged==7 ){
121 blob_appendf(report, "SYMLINK %s\n", zDisplayName);
122 }else if( isChnged==8 ){
123 blob_appendf(report, "UNEXEC %s\n", zDisplayName);
124 }else if( isChnged==9 ){
125 blob_appendf(report, "UNLINK %s\n", zDisplayName);
126 }else if( file_contains_merge_marker(zFullName) ){
127 blob_appendf(report, "CONFLICT %s\n", zDisplayName);
128 }else{
129 blob_appendf(report, "EDITED %s\n", zDisplayName);
130 }
@@ -1633,10 +1641,12 @@
1641 int dryRunFlag; /* True for a test run. Debugging only */
1642 CheckinInfo sCiInfo; /* Information about this check-in */
1643 const char *zComFile; /* Read commit message from this file */
1644 int nTag = 0; /* Number of --tag arguments */
1645 const char *zTag; /* A single --tag argument */
1646 ManifestFile *pFile; /* File structure in the manifest */
1647 Manifest *pManifest; /* Manifest structure */
1648 Blob manifest; /* Manifest in baseline form */
1649 Blob muuid; /* Manifest uuid */
1650 Blob cksum1, cksum2; /* Before and after commit checksums */
1651 Blob cksum1b; /* Checksum recorded in the manifest */
1652 int szD; /* Size of the delta manifest */
@@ -2070,11 +2080,10 @@
2080 blob_write_to_file(&muuid, zManifestFile);
2081 free(zManifestFile);
2082 blob_reset(&muuid);
2083 }
2084
 
2085 /* Update the vfile and vmerge tables */
2086 db_multi_exec(
2087 "DELETE FROM vfile WHERE (vid!=%d OR deleted) AND is_selected(id);"
2088 "DELETE FROM vmerge;"
2089 "UPDATE vfile SET vid=%d;"
@@ -2081,10 +2090,28 @@
2090 "UPDATE vfile SET rid=mrid, chnged=0, deleted=0, origname=NULL"
2091 " WHERE is_selected(id);"
2092 , vid, nvid
2093 );
2094 db_lset_int("checkout", nvid);
2095
2096 /* Update the isexe and islink columns of the vfile table */
2097 db_prepare(&q,
2098 "UPDATE vfile SET isexe=:exec, islink=:link"
2099 " WHERE vid=:vid AND pathname=:path AND (isexe!=:exec OR islink!=:link)"
2100 );
2101 db_bind_int(&q, ":vid", nvid);
2102 pManifest = manifest_get(nvid, CFTYPE_MANIFEST, 0);
2103 manifest_file_rewind(pManifest);
2104 while( (pFile = manifest_file_next(pManifest, 0)) ){
2105 db_bind_int(&q, ":exec", pFile->zPerm && strstr(pFile->zPerm, "x"));
2106 db_bind_int(&q, ":link", pFile->zPerm && strstr(pFile->zPerm, "l"));
2107 db_bind_text(&q, ":path", pFile->zName);
2108 db_step(&q);
2109 db_reset(&q);
2110 }
2111 db_finalize(&q);
2112 manifest_destroy(pManifest);
2113
2114 if( useCksum ){
2115 /* Verify that the repository checksum matches the expected checksum
2116 ** calculated before the check-in started (and stored as the R record
2117 ** of the manifest file).
2118
+35 -7
--- src/vfile.c
+++ src/vfile.c
@@ -136,15 +136,22 @@
136136
#define CKSIG_SETMTIME 0x004 /* Set mtime to last check-out time */
137137
138138
#endif /* INTERFACE */
139139
140140
/*
141
-** Look at every VFILE entry with the given vid and update
142
-** VFILE.CHNGED field according to whether or not
143
-** the file has changed. 0 means no change. 1 means edited. 2 means
144
-** the file has changed due to a merge. 3 means the file was added
145
-** by a merge.
141
+** Look at every VFILE entry with the given vid and update VFILE.CHNGED field
142
+** according to whether or not the file has changed.
143
+** - 0 means no change.
144
+** - 1 means edited.
145
+** - 2 means changed due to a merge.
146
+** - 3 means added by a merge.
147
+** - 4 means changed due to an integrate merge.
148
+** - 5 means added by an integrate merge.
149
+** - 6 means became executable but has unmodified contents.
150
+** - 7 means became a symlink whose target equals its old contents.
151
+** - 8 means lost executable status but has unmodified contents.
152
+** - 9 means lost symlink status and has contents equal to its old target.
146153
**
147154
** If VFILE.DELETED is true or if VFILE.RID is zero, then the file was either
148155
** removed from configuration management via "fossil rm" or added via
149156
** "fossil add", respectively, and in both cases we always know that
150157
** the file has changed without having the check the size, mtime,
@@ -170,18 +177,22 @@
170177
int useMtime = (cksigFlags & CKSIG_SHA1)==0
171178
&& db_get_boolean("mtime-changes", 1);
172179
173180
db_begin_transaction();
174181
db_prepare(&q, "SELECT id, %Q || pathname,"
175
- " vfile.mrid, deleted, chnged, uuid, size, mtime"
182
+ " vfile.mrid, deleted, chnged, uuid, size, mtime,"
183
+ " CASE WHEN isexe THEN %d WHEN islink THEN %d ELSE %d END"
176184
" FROM vfile LEFT JOIN blob ON vfile.mrid=blob.rid"
177
- " WHERE vid=%d ", g.zLocalRoot, vid);
185
+ " WHERE vid=%d ", g.zLocalRoot, PERM_EXE, PERM_LNK, PERM_REG,
186
+ vid);
178187
while( db_step(&q)==SQLITE_ROW ){
179188
int id, rid, isDeleted;
180189
const char *zName;
181190
int chnged = 0;
182191
int oldChnged;
192
+ int origPerm;
193
+ int currentPerm;
183194
i64 oldMtime;
184195
i64 currentMtime;
185196
i64 origSize;
186197
i64 currentSize;
187198
@@ -192,10 +203,12 @@
192203
oldChnged = chnged = db_column_int(&q, 4);
193204
oldMtime = db_column_int64(&q, 7);
194205
origSize = db_column_int64(&q, 6);
195206
currentSize = file_wd_size(zName);
196207
currentMtime = file_wd_mtime(0);
208
+ origPerm = db_column_int(&q, 8);
209
+ currentPerm = file_wd_perm(zName);
197210
if( chnged==0 && (isDeleted || rid==0) ){
198211
/* "fossil rm" or "fossil add" always change the file */
199212
chnged = 1;
200213
}else if( !file_wd_isfile_or_link(0) && currentSize>=0 ){
201214
if( cksigFlags & CKSIG_ENOTFILE ){
@@ -245,10 +258,25 @@
245258
file_set_mtime(zName, desiredMtime);
246259
currentMtime = file_wd_mtime(zName);
247260
}
248261
}
249262
}
263
+#ifndef _WIN32
264
+ if( chnged==0 || chnged==6 || chnged==7 || chnged==8 || chnged==9 ){
265
+ if( origPerm == currentPerm ){
266
+ chnged = 0;
267
+ }else if( currentPerm == PERM_EXE ){
268
+ chnged = 6;
269
+ }else if( currentPerm == PERM_LNK ){
270
+ chnged = 7;
271
+ }else if( origPerm == PERM_EXE ){
272
+ chnged = 8;
273
+ }else if( origPerm == PERM_LNK ){
274
+ chnged = 9;
275
+ }
276
+ }
277
+#endif
250278
if( currentMtime!=oldMtime || chnged!=oldChnged ){
251279
db_multi_exec("UPDATE vfile SET mtime=%lld, chnged=%d WHERE id=%d",
252280
currentMtime, chnged, id);
253281
}
254282
}
255283
--- src/vfile.c
+++ src/vfile.c
@@ -136,15 +136,22 @@
136 #define CKSIG_SETMTIME 0x004 /* Set mtime to last check-out time */
137
138 #endif /* INTERFACE */
139
140 /*
141 ** Look at every VFILE entry with the given vid and update
142 ** VFILE.CHNGED field according to whether or not
143 ** the file has changed. 0 means no change. 1 means edited. 2 means
144 ** the file has changed due to a merge. 3 means the file was added
145 ** by a merge.
 
 
 
 
 
 
 
146 **
147 ** If VFILE.DELETED is true or if VFILE.RID is zero, then the file was either
148 ** removed from configuration management via "fossil rm" or added via
149 ** "fossil add", respectively, and in both cases we always know that
150 ** the file has changed without having the check the size, mtime,
@@ -170,18 +177,22 @@
170 int useMtime = (cksigFlags & CKSIG_SHA1)==0
171 && db_get_boolean("mtime-changes", 1);
172
173 db_begin_transaction();
174 db_prepare(&q, "SELECT id, %Q || pathname,"
175 " vfile.mrid, deleted, chnged, uuid, size, mtime"
 
176 " FROM vfile LEFT JOIN blob ON vfile.mrid=blob.rid"
177 " WHERE vid=%d ", g.zLocalRoot, vid);
 
178 while( db_step(&q)==SQLITE_ROW ){
179 int id, rid, isDeleted;
180 const char *zName;
181 int chnged = 0;
182 int oldChnged;
 
 
183 i64 oldMtime;
184 i64 currentMtime;
185 i64 origSize;
186 i64 currentSize;
187
@@ -192,10 +203,12 @@
192 oldChnged = chnged = db_column_int(&q, 4);
193 oldMtime = db_column_int64(&q, 7);
194 origSize = db_column_int64(&q, 6);
195 currentSize = file_wd_size(zName);
196 currentMtime = file_wd_mtime(0);
 
 
197 if( chnged==0 && (isDeleted || rid==0) ){
198 /* "fossil rm" or "fossil add" always change the file */
199 chnged = 1;
200 }else if( !file_wd_isfile_or_link(0) && currentSize>=0 ){
201 if( cksigFlags & CKSIG_ENOTFILE ){
@@ -245,10 +258,25 @@
245 file_set_mtime(zName, desiredMtime);
246 currentMtime = file_wd_mtime(zName);
247 }
248 }
249 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
250 if( currentMtime!=oldMtime || chnged!=oldChnged ){
251 db_multi_exec("UPDATE vfile SET mtime=%lld, chnged=%d WHERE id=%d",
252 currentMtime, chnged, id);
253 }
254 }
255
--- src/vfile.c
+++ src/vfile.c
@@ -136,15 +136,22 @@
136 #define CKSIG_SETMTIME 0x004 /* Set mtime to last check-out time */
137
138 #endif /* INTERFACE */
139
140 /*
141 ** Look at every VFILE entry with the given vid and update VFILE.CHNGED field
142 ** according to whether or not the file has changed.
143 ** - 0 means no change.
144 ** - 1 means edited.
145 ** - 2 means changed due to a merge.
146 ** - 3 means added by a merge.
147 ** - 4 means changed due to an integrate merge.
148 ** - 5 means added by an integrate merge.
149 ** - 6 means became executable but has unmodified contents.
150 ** - 7 means became a symlink whose target equals its old contents.
151 ** - 8 means lost executable status but has unmodified contents.
152 ** - 9 means lost symlink status and has contents equal to its old target.
153 **
154 ** If VFILE.DELETED is true or if VFILE.RID is zero, then the file was either
155 ** removed from configuration management via "fossil rm" or added via
156 ** "fossil add", respectively, and in both cases we always know that
157 ** the file has changed without having the check the size, mtime,
@@ -170,18 +177,22 @@
177 int useMtime = (cksigFlags & CKSIG_SHA1)==0
178 && db_get_boolean("mtime-changes", 1);
179
180 db_begin_transaction();
181 db_prepare(&q, "SELECT id, %Q || pathname,"
182 " vfile.mrid, deleted, chnged, uuid, size, mtime,"
183 " CASE WHEN isexe THEN %d WHEN islink THEN %d ELSE %d END"
184 " FROM vfile LEFT JOIN blob ON vfile.mrid=blob.rid"
185 " WHERE vid=%d ", g.zLocalRoot, PERM_EXE, PERM_LNK, PERM_REG,
186 vid);
187 while( db_step(&q)==SQLITE_ROW ){
188 int id, rid, isDeleted;
189 const char *zName;
190 int chnged = 0;
191 int oldChnged;
192 int origPerm;
193 int currentPerm;
194 i64 oldMtime;
195 i64 currentMtime;
196 i64 origSize;
197 i64 currentSize;
198
@@ -192,10 +203,12 @@
203 oldChnged = chnged = db_column_int(&q, 4);
204 oldMtime = db_column_int64(&q, 7);
205 origSize = db_column_int64(&q, 6);
206 currentSize = file_wd_size(zName);
207 currentMtime = file_wd_mtime(0);
208 origPerm = db_column_int(&q, 8);
209 currentPerm = file_wd_perm(zName);
210 if( chnged==0 && (isDeleted || rid==0) ){
211 /* "fossil rm" or "fossil add" always change the file */
212 chnged = 1;
213 }else if( !file_wd_isfile_or_link(0) && currentSize>=0 ){
214 if( cksigFlags & CKSIG_ENOTFILE ){
@@ -245,10 +258,25 @@
258 file_set_mtime(zName, desiredMtime);
259 currentMtime = file_wd_mtime(zName);
260 }
261 }
262 }
263 #ifndef _WIN32
264 if( chnged==0 || chnged==6 || chnged==7 || chnged==8 || chnged==9 ){
265 if( origPerm == currentPerm ){
266 chnged = 0;
267 }else if( currentPerm == PERM_EXE ){
268 chnged = 6;
269 }else if( currentPerm == PERM_LNK ){
270 chnged = 7;
271 }else if( origPerm == PERM_EXE ){
272 chnged = 8;
273 }else if( origPerm == PERM_LNK ){
274 chnged = 9;
275 }
276 }
277 #endif
278 if( currentMtime!=oldMtime || chnged!=oldChnged ){
279 db_multi_exec("UPDATE vfile SET mtime=%lld, chnged=%d WHERE id=%d",
280 currentMtime, chnged, id);
281 }
282 }
283
--- www/changes.wiki
+++ www/changes.wiki
@@ -30,14 +30,17 @@
3030
leaves on the same branch.
3131
* Added the "Blitz" skin option.
3232
* Removed the ".fossil-settings/keep-glob" file. It should not have been
3333
checked into the repository.
3434
* Update the built-in SQLite to version 3.8.10.1.
35
- * Made [/help?cmd=open|fossil open] honor ".fossil-settings/allow-symlinks".
35
+ * Make [/help?cmd=open|fossil open] honor ".fossil-settings/allow-symlinks".
3636
* Allow [/help?cmd=add|fossil add] to be used on symlinks to nonexistent or
3737
unreadable files in the same way as [/help?cmd=addremove|fossil addremove].
3838
* Added fork warning to be issued if sync produced a fork
39
+ * Have [/help/cmd=changes|fossil changes] and
40
+ [/help/cmd=status|fossil status] report when executable or symlink status
41
+ changes on otherwise unmodified files.
3942
4043
<h2>Changes for Version 1.32 (2015-03-14)</h2>
4144
* When creating a new repository using [/help?cmd=init|fossil init], ensure
4245
that the new repository is fully compatible with historical versions of
4346
Fossil by having a valid manifest as RID 1.
4447
--- www/changes.wiki
+++ www/changes.wiki
@@ -30,14 +30,17 @@
30 leaves on the same branch.
31 * Added the "Blitz" skin option.
32 * Removed the ".fossil-settings/keep-glob" file. It should not have been
33 checked into the repository.
34 * Update the built-in SQLite to version 3.8.10.1.
35 * Made [/help?cmd=open|fossil open] honor ".fossil-settings/allow-symlinks".
36 * Allow [/help?cmd=add|fossil add] to be used on symlinks to nonexistent or
37 unreadable files in the same way as [/help?cmd=addremove|fossil addremove].
38 * Added fork warning to be issued if sync produced a fork
 
 
 
39
40 <h2>Changes for Version 1.32 (2015-03-14)</h2>
41 * When creating a new repository using [/help?cmd=init|fossil init], ensure
42 that the new repository is fully compatible with historical versions of
43 Fossil by having a valid manifest as RID 1.
44
--- www/changes.wiki
+++ www/changes.wiki
@@ -30,14 +30,17 @@
30 leaves on the same branch.
31 * Added the "Blitz" skin option.
32 * Removed the ".fossil-settings/keep-glob" file. It should not have been
33 checked into the repository.
34 * Update the built-in SQLite to version 3.8.10.1.
35 * Make [/help?cmd=open|fossil open] honor ".fossil-settings/allow-symlinks".
36 * Allow [/help?cmd=add|fossil add] to be used on symlinks to nonexistent or
37 unreadable files in the same way as [/help?cmd=addremove|fossil addremove].
38 * Added fork warning to be issued if sync produced a fork
39 * Have [/help/cmd=changes|fossil changes] and
40 [/help/cmd=status|fossil status] report when executable or symlink status
41 changes on otherwise unmodified files.
42
43 <h2>Changes for Version 1.32 (2015-03-14)</h2>
44 * When creating a new repository using [/help?cmd=init|fossil init], ensure
45 that the new repository is fully compatible with historical versions of
46 Fossil by having a valid manifest as RID 1.
47

Keyboard Shortcuts

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