Fossil SCM

merged trunk

Ratte 2010-09-19 06:15 wolfgangFormat2CSS_2 merge
Commit 5e7d7144ecf8d7534909e034e4df385e0ce9c4cd
+3 -3
--- src/allrepo.c
+++ src/allrepo.c
@@ -53,14 +53,14 @@
5353
**
5454
** Usage: %fossil all (list|ls|pull|push|rebuild|sync)
5555
**
5656
** The ~/.fossil file records the location of all repositories for a
5757
** user. This command performs certain operations on all repositories
58
-** that can be useful before or after a period of disconnection operation.
58
+** that can be useful before or after a period of disconnected operation.
5959
**
60
-** On Win32 systems, this file is located in %LOCALAPPDATA%, %APDDATA%
61
-** or %HOMEPATH% and is named _fossil.
60
+** On Win32 systems, the file is named "_fossil" and is located in
61
+** %LOCALAPPDATA%, %APPDATA% or %HOMEPATH%.
6262
**
6363
** Available operations are:
6464
**
6565
** list | ls Display the location of all repositories
6666
**
6767
--- src/allrepo.c
+++ src/allrepo.c
@@ -53,14 +53,14 @@
53 **
54 ** Usage: %fossil all (list|ls|pull|push|rebuild|sync)
55 **
56 ** The ~/.fossil file records the location of all repositories for a
57 ** user. This command performs certain operations on all repositories
58 ** that can be useful before or after a period of disconnection operation.
59 **
60 ** On Win32 systems, this file is located in %LOCALAPPDATA%, %APDDATA%
61 ** or %HOMEPATH% and is named _fossil.
62 **
63 ** Available operations are:
64 **
65 ** list | ls Display the location of all repositories
66 **
67
--- src/allrepo.c
+++ src/allrepo.c
@@ -53,14 +53,14 @@
53 **
54 ** Usage: %fossil all (list|ls|pull|push|rebuild|sync)
55 **
56 ** The ~/.fossil file records the location of all repositories for a
57 ** user. This command performs certain operations on all repositories
58 ** that can be useful before or after a period of disconnected operation.
59 **
60 ** On Win32 systems, the file is named "_fossil" and is located in
61 ** %LOCALAPPDATA%, %APPDATA% or %HOMEPATH%.
62 **
63 ** Available operations are:
64 **
65 ** list | ls Display the location of all repositories
66 **
67
+10
--- src/config.h
+++ src/config.h
@@ -15,10 +15,20 @@
1515
**
1616
*******************************************************************************
1717
**
1818
** A common header file used by all modules.
1919
*/
20
+
21
+/* The following macros are necessary for large-file support under
22
+** some linux distributions, and possibly other unixes as well.
23
+*/
24
+#define _LARGE_FILE 1
25
+#ifndef _FILE_OFFSET_BITS
26
+# define _FILE_OFFSET_BITS 64
27
+#endif
28
+#define _LARGEFILE_SOURCE 1
29
+
2030
2131
/*
2232
** System header files used by all modules
2333
*/
2434
#include <unistd.h>
2535
--- src/config.h
+++ src/config.h
@@ -15,10 +15,20 @@
15 **
16 *******************************************************************************
17 **
18 ** A common header file used by all modules.
19 */
 
 
 
 
 
 
 
 
 
 
20
21 /*
22 ** System header files used by all modules
23 */
24 #include <unistd.h>
25
--- src/config.h
+++ src/config.h
@@ -15,10 +15,20 @@
15 **
16 *******************************************************************************
17 **
18 ** A common header file used by all modules.
19 */
20
21 /* The following macros are necessary for large-file support under
22 ** some linux distributions, and possibly other unixes as well.
23 */
24 #define _LARGE_FILE 1
25 #ifndef _FILE_OFFSET_BITS
26 # define _FILE_OFFSET_BITS 64
27 #endif
28 #define _LARGEFILE_SOURCE 1
29
30
31 /*
32 ** System header files used by all modules
33 */
34 #include <unistd.h>
35
+18 -2
--- src/file.c
+++ src/file.c
@@ -23,12 +23,20 @@
2323
#include <unistd.h>
2424
#include "file.h"
2525
2626
/*
2727
** The file status information from the most recent stat() call.
28
+**
29
+** Use _stati64 rather than stat on windows, in order to handle files
30
+** larger than 2GB.
2831
*/
29
-static struct stat fileStat;
32
+#if defined(_WIN32) && defined(__MSVCRT__)
33
+ static struct _stati64 fileStat;
34
+# define stat _stati64
35
+#else
36
+ static struct stat fileStat;
37
+#endif
3038
static int fileStatValid = 0;
3139
3240
/*
3341
** Fill in the fileStat variable for the file named zFilename.
3442
** If zFilename==0, then use the previous value of fileStat if
@@ -291,21 +299,29 @@
291299
blob_resize(pOut, file_simplify_name(blob_buffer(pOut), blob_size(pOut)));
292300
}
293301
294302
/*
295303
** COMMAND: test-canonical-name
304
+** Usage: %fossil test-canonical-name FILENAME...
296305
**
297306
** Test the operation of the canonical name generator.
307
+** Also test Fossil's ability to measure attributes of a file.
298308
*/
299309
void cmd_test_canonical_name(void){
300310
int i;
301311
Blob x;
302312
blob_zero(&x);
303313
for(i=2; i<g.argc; i++){
304
- file_canonical_name(g.argv[i], &x);
314
+ const char *zName = g.argv[i];
315
+ file_canonical_name(zName, &x);
305316
printf("%s\n", blob_buffer(&x));
306317
blob_reset(&x);
318
+ printf(" file_size = %lld\n", file_size(zName));
319
+ printf(" file_mtime = %lld\n", file_mtime(zName));
320
+ printf(" file_isfile = %d\n", file_isfile(zName));
321
+ printf(" file_isexe = %d\n", file_isexe(zName));
322
+ printf(" file_isdir = %d\n", file_isdir(zName));
307323
}
308324
}
309325
310326
/*
311327
** Return TRUE if the given filename is canonical.
312328
--- src/file.c
+++ src/file.c
@@ -23,12 +23,20 @@
23 #include <unistd.h>
24 #include "file.h"
25
26 /*
27 ** The file status information from the most recent stat() call.
 
 
 
28 */
29 static struct stat fileStat;
 
 
 
 
 
30 static int fileStatValid = 0;
31
32 /*
33 ** Fill in the fileStat variable for the file named zFilename.
34 ** If zFilename==0, then use the previous value of fileStat if
@@ -291,21 +299,29 @@
291 blob_resize(pOut, file_simplify_name(blob_buffer(pOut), blob_size(pOut)));
292 }
293
294 /*
295 ** COMMAND: test-canonical-name
 
296 **
297 ** Test the operation of the canonical name generator.
 
298 */
299 void cmd_test_canonical_name(void){
300 int i;
301 Blob x;
302 blob_zero(&x);
303 for(i=2; i<g.argc; i++){
304 file_canonical_name(g.argv[i], &x);
 
305 printf("%s\n", blob_buffer(&x));
306 blob_reset(&x);
 
 
 
 
 
307 }
308 }
309
310 /*
311 ** Return TRUE if the given filename is canonical.
312
--- src/file.c
+++ src/file.c
@@ -23,12 +23,20 @@
23 #include <unistd.h>
24 #include "file.h"
25
26 /*
27 ** The file status information from the most recent stat() call.
28 **
29 ** Use _stati64 rather than stat on windows, in order to handle files
30 ** larger than 2GB.
31 */
32 #if defined(_WIN32) && defined(__MSVCRT__)
33 static struct _stati64 fileStat;
34 # define stat _stati64
35 #else
36 static struct stat fileStat;
37 #endif
38 static int fileStatValid = 0;
39
40 /*
41 ** Fill in the fileStat variable for the file named zFilename.
42 ** If zFilename==0, then use the previous value of fileStat if
@@ -291,21 +299,29 @@
299 blob_resize(pOut, file_simplify_name(blob_buffer(pOut), blob_size(pOut)));
300 }
301
302 /*
303 ** COMMAND: test-canonical-name
304 ** Usage: %fossil test-canonical-name FILENAME...
305 **
306 ** Test the operation of the canonical name generator.
307 ** Also test Fossil's ability to measure attributes of a file.
308 */
309 void cmd_test_canonical_name(void){
310 int i;
311 Blob x;
312 blob_zero(&x);
313 for(i=2; i<g.argc; i++){
314 const char *zName = g.argv[i];
315 file_canonical_name(zName, &x);
316 printf("%s\n", blob_buffer(&x));
317 blob_reset(&x);
318 printf(" file_size = %lld\n", file_size(zName));
319 printf(" file_mtime = %lld\n", file_mtime(zName));
320 printf(" file_isfile = %d\n", file_isfile(zName));
321 printf(" file_isexe = %d\n", file_isexe(zName));
322 printf(" file_isdir = %d\n", file_isdir(zName));
323 }
324 }
325
326 /*
327 ** Return TRUE if the given filename is canonical.
328
+4 -3
--- src/stat.c
+++ src/stat.c
@@ -26,22 +26,23 @@
2626
** WEBPAGE: stat
2727
**
2828
** Show statistics and global information about the repository.
2929
*/
3030
void stat_page(void){
31
- i64 t;
32
- int n, m, fsize;
31
+ i64 t, fsize;
32
+ int n, m;
3333
int szMax, szAvg;
3434
char zBuf[100];
3535
3636
login_check_credentials();
3737
if( !g.okRead ){ login_needed(); return; }
3838
style_header("Repository Statistics");
3939
@ <table class="label-value">
4040
@ <tr><th>Repository&nbsp;Size:</th><td>
4141
fsize = file_size(g.zRepositoryName);
42
- @ %d(fsize) bytes
42
+ sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", fsize);
43
+ @ %s(zBuf) bytes
4344
@ </td></tr>
4445
@ <tr><th>Number&nbsp;Of&nbsp;Artifacts:</th><td>
4546
n = db_int(0, "SELECT count(*) FROM blob");
4647
m = db_int(0, "SELECT count(*) FROM delta");
4748
@ %d(n) (stored as %d(n-m) full text and %d(m) delta blobs)
4849
--- src/stat.c
+++ src/stat.c
@@ -26,22 +26,23 @@
26 ** WEBPAGE: stat
27 **
28 ** Show statistics and global information about the repository.
29 */
30 void stat_page(void){
31 i64 t;
32 int n, m, fsize;
33 int szMax, szAvg;
34 char zBuf[100];
35
36 login_check_credentials();
37 if( !g.okRead ){ login_needed(); return; }
38 style_header("Repository Statistics");
39 @ <table class="label-value">
40 @ <tr><th>Repository&nbsp;Size:</th><td>
41 fsize = file_size(g.zRepositoryName);
42 @ %d(fsize) bytes
 
43 @ </td></tr>
44 @ <tr><th>Number&nbsp;Of&nbsp;Artifacts:</th><td>
45 n = db_int(0, "SELECT count(*) FROM blob");
46 m = db_int(0, "SELECT count(*) FROM delta");
47 @ %d(n) (stored as %d(n-m) full text and %d(m) delta blobs)
48
--- src/stat.c
+++ src/stat.c
@@ -26,22 +26,23 @@
26 ** WEBPAGE: stat
27 **
28 ** Show statistics and global information about the repository.
29 */
30 void stat_page(void){
31 i64 t, fsize;
32 int n, m;
33 int szMax, szAvg;
34 char zBuf[100];
35
36 login_check_credentials();
37 if( !g.okRead ){ login_needed(); return; }
38 style_header("Repository Statistics");
39 @ <table class="label-value">
40 @ <tr><th>Repository&nbsp;Size:</th><td>
41 fsize = file_size(g.zRepositoryName);
42 sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", fsize);
43 @ %s(zBuf) bytes
44 @ </td></tr>
45 @ <tr><th>Number&nbsp;Of&nbsp;Artifacts:</th><td>
46 n = db_int(0, "SELECT count(*) FROM blob");
47 m = db_int(0, "SELECT count(*) FROM delta");
48 @ %d(n) (stored as %d(n-m) full text and %d(m) delta blobs)
49

Keyboard Shortcuts

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