Fossil SCM

Enhance [/help?cmd=changes | fossil changes] and [/help?cmd=status | fossil status] the same way.

jan.nijtmans 2013-06-21 14:28 trunk
Commit eb4d631c636dd6bcd4f622fd1f44888c06ef2535
2 files changed +21 -3 +4 -3
+21 -3
--- src/checkin.c
+++ src/checkin.c
@@ -39,15 +39,32 @@
3939
){
4040
Stmt q;
4141
int nPrefix = strlen(zPrefix);
4242
int nErr = 0;
4343
Blob rewrittenPathname;
44
+ Blob where;
45
+ const char *zTreeName;
46
+ int i, nRoot;
47
+
48
+ nRoot = (int)strlen(g.zLocalRoot);
49
+ for(i=2; i<g.argc; i++) {
50
+ Blob fname;
51
+ file_canonical_name(g.argv[i], &fname, 0);
52
+ zTreeName = blob_str(&fname)+nRoot;
53
+ blob_appendf(&where, " %s (pathname=%Q %s) "
54
+ "OR (pathname>'%q/' %s AND pathname<'%q0' %s)",
55
+ (blob_size(&where)>0) ? "OR" : "AND", zTreeName,
56
+ filename_collation(), zTreeName, filename_collation(),
57
+ zTreeName, filename_collation());
58
+ }
59
+
4460
db_prepare(&q,
4561
"SELECT pathname, deleted, chnged, rid, coalesce(origname!=pathname,0)"
4662
" FROM vfile "
47
- " WHERE is_selected(id)"
48
- " AND (chnged OR deleted OR rid=0 OR pathname!=origname) ORDER BY 1"
63
+ " WHERE is_selected(id) %s"
64
+ " AND (chnged OR deleted OR rid=0 OR pathname!=origname) ORDER BY 1",
65
+ blob_str(&where)
4966
);
5067
blob_zero(&rewrittenPathname);
5168
while( db_step(&q)==SQLITE_ROW ){
5269
const char *zPathname = db_column_text(&q,0);
5370
const char *zDisplayName = zPathname;
@@ -725,11 +742,12 @@
725742
g.aCommitFile = fossil_malloc(sizeof(int)*(g.argc-1));
726743
727744
for(ii=2; ii<g.argc; ii++){
728745
int iId;
729746
file_tree_name(g.argv[ii], &b, 1);
730
- iId = db_int(-1, "SELECT id FROM vfile WHERE pathname=%Q", blob_str(&b));
747
+ iId = db_int(-1, "SELECT id FROM vfile WHERE pathname=%Q %s",
748
+ blob_str(&b), filename_collation() );
731749
if( iId<0 ){
732750
fossil_warning("fossil knows nothing about: %s", g.argv[ii]);
733751
result = 1;
734752
}else{
735753
g.aCommitFile[jj++] = iId;
736754
--- src/checkin.c
+++ src/checkin.c
@@ -39,15 +39,32 @@
39 ){
40 Stmt q;
41 int nPrefix = strlen(zPrefix);
42 int nErr = 0;
43 Blob rewrittenPathname;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44 db_prepare(&q,
45 "SELECT pathname, deleted, chnged, rid, coalesce(origname!=pathname,0)"
46 " FROM vfile "
47 " WHERE is_selected(id)"
48 " AND (chnged OR deleted OR rid=0 OR pathname!=origname) ORDER BY 1"
 
49 );
50 blob_zero(&rewrittenPathname);
51 while( db_step(&q)==SQLITE_ROW ){
52 const char *zPathname = db_column_text(&q,0);
53 const char *zDisplayName = zPathname;
@@ -725,11 +742,12 @@
725 g.aCommitFile = fossil_malloc(sizeof(int)*(g.argc-1));
726
727 for(ii=2; ii<g.argc; ii++){
728 int iId;
729 file_tree_name(g.argv[ii], &b, 1);
730 iId = db_int(-1, "SELECT id FROM vfile WHERE pathname=%Q", blob_str(&b));
 
731 if( iId<0 ){
732 fossil_warning("fossil knows nothing about: %s", g.argv[ii]);
733 result = 1;
734 }else{
735 g.aCommitFile[jj++] = iId;
736
--- src/checkin.c
+++ src/checkin.c
@@ -39,15 +39,32 @@
39 ){
40 Stmt q;
41 int nPrefix = strlen(zPrefix);
42 int nErr = 0;
43 Blob rewrittenPathname;
44 Blob where;
45 const char *zTreeName;
46 int i, nRoot;
47
48 nRoot = (int)strlen(g.zLocalRoot);
49 for(i=2; i<g.argc; i++) {
50 Blob fname;
51 file_canonical_name(g.argv[i], &fname, 0);
52 zTreeName = blob_str(&fname)+nRoot;
53 blob_appendf(&where, " %s (pathname=%Q %s) "
54 "OR (pathname>'%q/' %s AND pathname<'%q0' %s)",
55 (blob_size(&where)>0) ? "OR" : "AND", zTreeName,
56 filename_collation(), zTreeName, filename_collation(),
57 zTreeName, filename_collation());
58 }
59
60 db_prepare(&q,
61 "SELECT pathname, deleted, chnged, rid, coalesce(origname!=pathname,0)"
62 " FROM vfile "
63 " WHERE is_selected(id) %s"
64 " AND (chnged OR deleted OR rid=0 OR pathname!=origname) ORDER BY 1",
65 blob_str(&where)
66 );
67 blob_zero(&rewrittenPathname);
68 while( db_step(&q)==SQLITE_ROW ){
69 const char *zPathname = db_column_text(&q,0);
70 const char *zDisplayName = zPathname;
@@ -725,11 +742,12 @@
742 g.aCommitFile = fossil_malloc(sizeof(int)*(g.argc-1));
743
744 for(ii=2; ii<g.argc; ii++){
745 int iId;
746 file_tree_name(g.argv[ii], &b, 1);
747 iId = db_int(-1, "SELECT id FROM vfile WHERE pathname=%Q %s",
748 blob_str(&b), filename_collation() );
749 if( iId<0 ){
750 fossil_warning("fossil knows nothing about: %s", g.argv[ii]);
751 result = 1;
752 }else{
753 g.aCommitFile[jj++] = iId;
754
--- www/changes.wiki
+++ www/changes.wiki
@@ -1,11 +1,12 @@
11
<title>Change Log</title>
22
33
<h2>Changes For Version 1.27 (as yet unreleased)</h2>
4
- * Enhance the [/help?cmd=clean | fossil clean],
5
- [/help?cmd=extras | fossil extras] and [/help?cmd=ls | fossil ls] commands to
6
- restrict operation to files and directories named on the command-line.
4
+ * Enhance the [/help?cmd=changes | fossil changes],
5
+ [/help?cmd=clean | fossil clean], [/help?cmd=extras | fossil extras],
6
+ [/help?cmd=ls | fossil ls] and [/help?cmd=status | fossil status] commands
7
+ to restrict operation to files and directories named on the command-line.
78
89
<h2>Changes For Version 1.26 (2013-06-18)</h2>
910
* The argument to the --port option for the [/help?cmd=ui | fossil ui] and
1011
[/help?cmd=server | fossil server] commands can take an IP address in addition
1112
to the port number, causing Fossil to bind to just that one IP address.
1213
--- www/changes.wiki
+++ www/changes.wiki
@@ -1,11 +1,12 @@
1 <title>Change Log</title>
2
3 <h2>Changes For Version 1.27 (as yet unreleased)</h2>
4 * Enhance the [/help?cmd=clean | fossil clean],
5 [/help?cmd=extras | fossil extras] and [/help?cmd=ls | fossil ls] commands to
6 restrict operation to files and directories named on the command-line.
 
7
8 <h2>Changes For Version 1.26 (2013-06-18)</h2>
9 * The argument to the --port option for the [/help?cmd=ui | fossil ui] and
10 [/help?cmd=server | fossil server] commands can take an IP address in addition
11 to the port number, causing Fossil to bind to just that one IP address.
12
--- www/changes.wiki
+++ www/changes.wiki
@@ -1,11 +1,12 @@
1 <title>Change Log</title>
2
3 <h2>Changes For Version 1.27 (as yet unreleased)</h2>
4 * Enhance the [/help?cmd=changes | fossil changes],
5 [/help?cmd=clean | fossil clean], [/help?cmd=extras | fossil extras],
6 [/help?cmd=ls | fossil ls] and [/help?cmd=status | fossil status] commands
7 to restrict operation to files and directories named on the command-line.
8
9 <h2>Changes For Version 1.26 (2013-06-18)</h2>
10 * The argument to the --port option for the [/help?cmd=ui | fossil ui] and
11 [/help?cmd=server | fossil server] commands can take an IP address in addition
12 to the port number, causing Fossil to bind to just that one IP address.
13

Keyboard Shortcuts

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