Fossil SCM

Enhance the options for the 'reparent' command: add --date-override and --user-override

florian 2018-12-26 08:02 UTC cmd-options-amend
Commit df85c3f9abf78e6ada102cc6ea8ba1b9dffb5fee4c002ba4f4218c1cd1c3fd63
1 file changed +8 -1
+8 -1
--- src/tag.c
+++ src/tag.c
@@ -606,20 +606,26 @@
606606
** --test Make database entries but do not add the tag artifact.
607607
** So the reparent operation will be undone by the next
608608
** "fossil rebuild" command.
609609
** --dryrun | -n Print the tag that would have been created but do not
610610
** actually change the database in any way.
611
+** --date-override DATETIME Set the change time on the control artifact
612
+** --user-override USER Set the user name on the control artifact
611613
*/
612614
void reparent_cmd(void){
613615
int bTest = find_option("test","",0)!=0;
614616
int rid;
615617
int i;
616618
Blob value;
617619
char *zUuid;
618620
int dryRun = 0;
621
+ const char *zDateOvrd; /* The change time on the control artifact */
622
+ const char *zUserOvrd; /* The user name on the control artifact */
619623
620624
if( find_option("dryrun","n",0)!=0 ) dryRun = TAG_ADD_DRYRUN;
625
+ zDateOvrd = find_option("date-override",0,1);
626
+ zUserOvrd = find_option("user-override",0,1);
621627
db_find_and_open_repository(0, 0);
622628
verify_all_options();
623629
if( g.argc<4 ){
624630
usage("[OPTIONS] CHECK-IN PARENT ...");
625631
}
@@ -634,11 +640,12 @@
634640
}
635641
if( bTest && !dryRun ){
636642
tag_insert("parent", 1, blob_str(&value), -1, 0.0, rid);
637643
}else{
638644
zUuid = rid_to_uuid(rid);
639
- tag_add_artifact("","parent",zUuid,blob_str(&value),1|dryRun,0,0);
645
+ tag_add_artifact("","parent",zUuid,blob_str(&value),1|dryRun,
646
+ zDateOvrd,zUserOvrd);
640647
}
641648
}
642649
643650
644651
/*
645652
--- src/tag.c
+++ src/tag.c
@@ -606,20 +606,26 @@
606 ** --test Make database entries but do not add the tag artifact.
607 ** So the reparent operation will be undone by the next
608 ** "fossil rebuild" command.
609 ** --dryrun | -n Print the tag that would have been created but do not
610 ** actually change the database in any way.
 
 
611 */
612 void reparent_cmd(void){
613 int bTest = find_option("test","",0)!=0;
614 int rid;
615 int i;
616 Blob value;
617 char *zUuid;
618 int dryRun = 0;
 
 
619
620 if( find_option("dryrun","n",0)!=0 ) dryRun = TAG_ADD_DRYRUN;
 
 
621 db_find_and_open_repository(0, 0);
622 verify_all_options();
623 if( g.argc<4 ){
624 usage("[OPTIONS] CHECK-IN PARENT ...");
625 }
@@ -634,11 +640,12 @@
634 }
635 if( bTest && !dryRun ){
636 tag_insert("parent", 1, blob_str(&value), -1, 0.0, rid);
637 }else{
638 zUuid = rid_to_uuid(rid);
639 tag_add_artifact("","parent",zUuid,blob_str(&value),1|dryRun,0,0);
 
640 }
641 }
642
643
644 /*
645
--- src/tag.c
+++ src/tag.c
@@ -606,20 +606,26 @@
606 ** --test Make database entries but do not add the tag artifact.
607 ** So the reparent operation will be undone by the next
608 ** "fossil rebuild" command.
609 ** --dryrun | -n Print the tag that would have been created but do not
610 ** actually change the database in any way.
611 ** --date-override DATETIME Set the change time on the control artifact
612 ** --user-override USER Set the user name on the control artifact
613 */
614 void reparent_cmd(void){
615 int bTest = find_option("test","",0)!=0;
616 int rid;
617 int i;
618 Blob value;
619 char *zUuid;
620 int dryRun = 0;
621 const char *zDateOvrd; /* The change time on the control artifact */
622 const char *zUserOvrd; /* The user name on the control artifact */
623
624 if( find_option("dryrun","n",0)!=0 ) dryRun = TAG_ADD_DRYRUN;
625 zDateOvrd = find_option("date-override",0,1);
626 zUserOvrd = find_option("user-override",0,1);
627 db_find_and_open_repository(0, 0);
628 verify_all_options();
629 if( g.argc<4 ){
630 usage("[OPTIONS] CHECK-IN PARENT ...");
631 }
@@ -634,11 +640,12 @@
640 }
641 if( bTest && !dryRun ){
642 tag_insert("parent", 1, blob_str(&value), -1, 0.0, rid);
643 }else{
644 zUuid = rid_to_uuid(rid);
645 tag_add_artifact("","parent",zUuid,blob_str(&value),1|dryRun,
646 zDateOvrd,zUserOvrd);
647 }
648 }
649
650
651 /*
652

Keyboard Shortcuts

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