Fossil SCM
Enhance the options for the 'reparent' command: add --date-override and --user-override
Commit
df85c3f9abf78e6ada102cc6ea8ba1b9dffb5fee4c002ba4f4218c1cd1c3fd63
Parent
54928ff4b6855d9…
1 file changed
+8
-1
+8
-1
| --- src/tag.c | ||
| +++ src/tag.c | ||
| @@ -606,20 +606,26 @@ | ||
| 606 | 606 | ** --test Make database entries but do not add the tag artifact. |
| 607 | 607 | ** So the reparent operation will be undone by the next |
| 608 | 608 | ** "fossil rebuild" command. |
| 609 | 609 | ** --dryrun | -n Print the tag that would have been created but do not |
| 610 | 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 | |
| 611 | 613 | */ |
| 612 | 614 | void reparent_cmd(void){ |
| 613 | 615 | int bTest = find_option("test","",0)!=0; |
| 614 | 616 | int rid; |
| 615 | 617 | int i; |
| 616 | 618 | Blob value; |
| 617 | 619 | char *zUuid; |
| 618 | 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 */ | |
| 619 | 623 | |
| 620 | 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); | |
| 621 | 627 | db_find_and_open_repository(0, 0); |
| 622 | 628 | verify_all_options(); |
| 623 | 629 | if( g.argc<4 ){ |
| 624 | 630 | usage("[OPTIONS] CHECK-IN PARENT ..."); |
| 625 | 631 | } |
| @@ -634,11 +640,12 @@ | ||
| 634 | 640 | } |
| 635 | 641 | if( bTest && !dryRun ){ |
| 636 | 642 | tag_insert("parent", 1, blob_str(&value), -1, 0.0, rid); |
| 637 | 643 | }else{ |
| 638 | 644 | 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); | |
| 640 | 647 | } |
| 641 | 648 | } |
| 642 | 649 | |
| 643 | 650 | |
| 644 | 651 | /* |
| 645 | 652 |
| --- 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 |