Fossil SCM

Fix the "finfo" command so that -r is not required with -i. If the -r is omitted, then "current" is used in its place.

drh 2022-09-23 16:44 UTC trunk
Commit 35c6d15a08f1e3f7f1a8782c95b182bd5322cfd64978997ee513839db5217a81
2 files changed +2 -2 +1 -1
+2 -2
--- src/finfo.c
+++ src/finfo.c
@@ -146,12 +146,12 @@
146146
int rid;
147147
const char *zRevision = find_option("revision", "r", 1);
148148
149149
verify_all_options();
150150
151
- if( zRevision==0 ) usage("-i|--id also requires -r|--revision");
152
- if( g.argc!=3 ) usage("-r|--revision REVISION FILENAME");
151
+ if( zRevision==0 ) zRevision = "current";
152
+ if( g.argc!=3 ) usage("FILENAME");
153153
file_tree_name(g.argv[2], &fname, 0, 1);
154154
rid = db_int(0, "SELECT rid FROM blob WHERE uuid ="
155155
" (SELECT uuid FROM files_of_checkin(%Q)"
156156
" WHERE filename=%B %s)",
157157
zRevision, &fname, filename_collation());
158158
--- src/finfo.c
+++ src/finfo.c
@@ -146,12 +146,12 @@
146 int rid;
147 const char *zRevision = find_option("revision", "r", 1);
148
149 verify_all_options();
150
151 if( zRevision==0 ) usage("-i|--id also requires -r|--revision");
152 if( g.argc!=3 ) usage("-r|--revision REVISION FILENAME");
153 file_tree_name(g.argv[2], &fname, 0, 1);
154 rid = db_int(0, "SELECT rid FROM blob WHERE uuid ="
155 " (SELECT uuid FROM files_of_checkin(%Q)"
156 " WHERE filename=%B %s)",
157 zRevision, &fname, filename_collation());
158
--- src/finfo.c
+++ src/finfo.c
@@ -146,12 +146,12 @@
146 int rid;
147 const char *zRevision = find_option("revision", "r", 1);
148
149 verify_all_options();
150
151 if( zRevision==0 ) zRevision = "current";
152 if( g.argc!=3 ) usage("FILENAME");
153 file_tree_name(g.argv[2], &fname, 0, 1);
154 rid = db_int(0, "SELECT rid FROM blob WHERE uuid ="
155 " (SELECT uuid FROM files_of_checkin(%Q)"
156 " WHERE filename=%B %s)",
157 zRevision, &fname, filename_collation());
158
+1 -1
--- src/timeline.c
+++ src/timeline.c
@@ -1594,11 +1594,11 @@
15941594
** rel ... also show related checkins
15951595
** uf=FILE_HASH Show only check-ins that contain the given file version
15961596
** All qualifying check-ins are shown unless there is
15971597
** also an n= or n1= query parameter.
15981598
** chng=GLOBLIST Show only check-ins that involve changes to a file whose
1599
-** name matches one of the comma-separate GLOBLIST
1599
+** name matches one of the comma-separate GLOBLIST
16001600
** brbg Background color determined by branch name
16011601
** ubg Background color determined by user
16021602
** deltabg Background color red for delta manifests or green
16031603
** for baseline manifests
16041604
** namechng Show only check-ins that have filename changes
16051605
--- src/timeline.c
+++ src/timeline.c
@@ -1594,11 +1594,11 @@
1594 ** rel ... also show related checkins
1595 ** uf=FILE_HASH Show only check-ins that contain the given file version
1596 ** All qualifying check-ins are shown unless there is
1597 ** also an n= or n1= query parameter.
1598 ** chng=GLOBLIST Show only check-ins that involve changes to a file whose
1599 ** name matches one of the comma-separate GLOBLIST
1600 ** brbg Background color determined by branch name
1601 ** ubg Background color determined by user
1602 ** deltabg Background color red for delta manifests or green
1603 ** for baseline manifests
1604 ** namechng Show only check-ins that have filename changes
1605
--- src/timeline.c
+++ src/timeline.c
@@ -1594,11 +1594,11 @@
1594 ** rel ... also show related checkins
1595 ** uf=FILE_HASH Show only check-ins that contain the given file version
1596 ** All qualifying check-ins are shown unless there is
1597 ** also an n= or n1= query parameter.
1598 ** chng=GLOBLIST Show only check-ins that involve changes to a file whose
1599 ** name matches one of the comma-separate GLOBLIST
1600 ** brbg Background color determined by branch name
1601 ** ubg Background color determined by user
1602 ** deltabg Background color red for delta manifests or green
1603 ** for baseline manifests
1604 ** namechng Show only check-ins that have filename changes
1605

Keyboard Shortcuts

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