Fossil SCM

Enhance the 'fossil extras' and 'fossil all extras' commands using the new --header option to get them to print the associated repository first.

mistachkin 2014-04-03 19:13 trunk
Commit 69974aaa19c7cced4260543ab5b6cfc7810e9af7
2 files changed +5 -1 +7
+5 -1
--- src/allrepo.c
+++ src/allrepo.c
@@ -188,11 +188,15 @@
188188
collect_argument(&extra, "temp",0);
189189
collect_argument(&extra, "verbose","v");
190190
collect_argument(&extra, "whatif",0);
191191
useCheckouts = 1;
192192
}else if( strncmp(zCmd, "extras", n)==0 ){
193
- zCmd = "extras --chdir";
193
+ if( showFile ){
194
+ zCmd = "extras --chdir";
195
+ }else{
196
+ zCmd = "extras --header --chdir";
197
+ }
194198
collect_argument(&extra, "abs-paths",0);
195199
collect_argument_value(&extra, "case-sensitive");
196200
collect_argument(&extra, "dotfiles",0);
197201
collect_argument_value(&extra, "ignore");
198202
collect_argument(&extra, "rel-paths",0);
199203
--- src/allrepo.c
+++ src/allrepo.c
@@ -188,11 +188,15 @@
188 collect_argument(&extra, "temp",0);
189 collect_argument(&extra, "verbose","v");
190 collect_argument(&extra, "whatif",0);
191 useCheckouts = 1;
192 }else if( strncmp(zCmd, "extras", n)==0 ){
193 zCmd = "extras --chdir";
 
 
 
 
194 collect_argument(&extra, "abs-paths",0);
195 collect_argument_value(&extra, "case-sensitive");
196 collect_argument(&extra, "dotfiles",0);
197 collect_argument_value(&extra, "ignore");
198 collect_argument(&extra, "rel-paths",0);
199
--- src/allrepo.c
+++ src/allrepo.c
@@ -188,11 +188,15 @@
188 collect_argument(&extra, "temp",0);
189 collect_argument(&extra, "verbose","v");
190 collect_argument(&extra, "whatif",0);
191 useCheckouts = 1;
192 }else if( strncmp(zCmd, "extras", n)==0 ){
193 if( showFile ){
194 zCmd = "extras --chdir";
195 }else{
196 zCmd = "extras --header --chdir";
197 }
198 collect_argument(&extra, "abs-paths",0);
199 collect_argument_value(&extra, "case-sensitive");
200 collect_argument(&extra, "dotfiles",0);
201 collect_argument_value(&extra, "ignore");
202 collect_argument(&extra, "rel-paths",0);
203
--- src/checkin.c
+++ src/checkin.c
@@ -433,10 +433,11 @@
433433
**
434434
** Options:
435435
** --abs-paths Display absolute pathnames.
436436
** --case-sensitive <BOOL> override case-sensitive setting
437437
** --dotfiles include files beginning with a dot (".")
438
+** --header Identify the repository if there are extras
438439
** --ignore <CSG> ignore files matching patterns from the argument
439440
** --rel-paths Display pathnames relative to the current working
440441
** directory.
441442
**
442443
** See also: changes, clean, status
@@ -443,10 +444,11 @@
443444
*/
444445
void extras_cmd(void){
445446
Stmt q;
446447
const char *zIgnoreFlag = find_option("ignore",0,1);
447448
unsigned scanFlags = find_option("dotfiles",0,0)!=0 ? SCAN_ALL : 0;
449
+ int showHdr = find_option("header",0,0)!=0;
448450
int cwdRelative = 0;
449451
Glob *pIgnore;
450452
Blob rewrittenPathname;
451453
const char *zPathname, *zDisplayName;
452454
@@ -477,10 +479,15 @@
477479
zDisplayName = blob_str(&rewrittenPathname);
478480
if( zDisplayName[0]=='.' && zDisplayName[1]=='/' ){
479481
zDisplayName += 2; /* no unnecessary ./ prefix */
480482
}
481483
}
484
+ if( showHdr ){
485
+ showHdr = 0;
486
+ fossil_print("Extras for %s at %s:\n", db_get("project-name","???"),
487
+ g.zLocalRoot);
488
+ }
482489
fossil_print("%s\n", zDisplayName);
483490
}
484491
blob_reset(&rewrittenPathname);
485492
db_finalize(&q);
486493
}
487494
--- src/checkin.c
+++ src/checkin.c
@@ -433,10 +433,11 @@
433 **
434 ** Options:
435 ** --abs-paths Display absolute pathnames.
436 ** --case-sensitive <BOOL> override case-sensitive setting
437 ** --dotfiles include files beginning with a dot (".")
 
438 ** --ignore <CSG> ignore files matching patterns from the argument
439 ** --rel-paths Display pathnames relative to the current working
440 ** directory.
441 **
442 ** See also: changes, clean, status
@@ -443,10 +444,11 @@
443 */
444 void extras_cmd(void){
445 Stmt q;
446 const char *zIgnoreFlag = find_option("ignore",0,1);
447 unsigned scanFlags = find_option("dotfiles",0,0)!=0 ? SCAN_ALL : 0;
 
448 int cwdRelative = 0;
449 Glob *pIgnore;
450 Blob rewrittenPathname;
451 const char *zPathname, *zDisplayName;
452
@@ -477,10 +479,15 @@
477 zDisplayName = blob_str(&rewrittenPathname);
478 if( zDisplayName[0]=='.' && zDisplayName[1]=='/' ){
479 zDisplayName += 2; /* no unnecessary ./ prefix */
480 }
481 }
 
 
 
 
 
482 fossil_print("%s\n", zDisplayName);
483 }
484 blob_reset(&rewrittenPathname);
485 db_finalize(&q);
486 }
487
--- src/checkin.c
+++ src/checkin.c
@@ -433,10 +433,11 @@
433 **
434 ** Options:
435 ** --abs-paths Display absolute pathnames.
436 ** --case-sensitive <BOOL> override case-sensitive setting
437 ** --dotfiles include files beginning with a dot (".")
438 ** --header Identify the repository if there are extras
439 ** --ignore <CSG> ignore files matching patterns from the argument
440 ** --rel-paths Display pathnames relative to the current working
441 ** directory.
442 **
443 ** See also: changes, clean, status
@@ -443,10 +444,11 @@
444 */
445 void extras_cmd(void){
446 Stmt q;
447 const char *zIgnoreFlag = find_option("ignore",0,1);
448 unsigned scanFlags = find_option("dotfiles",0,0)!=0 ? SCAN_ALL : 0;
449 int showHdr = find_option("header",0,0)!=0;
450 int cwdRelative = 0;
451 Glob *pIgnore;
452 Blob rewrittenPathname;
453 const char *zPathname, *zDisplayName;
454
@@ -477,10 +479,15 @@
479 zDisplayName = blob_str(&rewrittenPathname);
480 if( zDisplayName[0]=='.' && zDisplayName[1]=='/' ){
481 zDisplayName += 2; /* no unnecessary ./ prefix */
482 }
483 }
484 if( showHdr ){
485 showHdr = 0;
486 fossil_print("Extras for %s at %s:\n", db_get("project-name","???"),
487 g.zLocalRoot);
488 }
489 fossil_print("%s\n", zDisplayName);
490 }
491 blob_reset(&rewrittenPathname);
492 db_finalize(&q);
493 }
494

Keyboard Shortcuts

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