Fossil SCM

Add the --no-svn-rev command line option to the "import svn" command that will skip the automatic tagging of every checkins with "svn-rev-nnn" tags. Proposition for the svn-import branch..

mgagnon 2015-02-15 19:34 svn-import
Commit 3c24fede5ae7f6b86646cb2c084dd94c4cef3247
1 file changed +14 -4
+14 -4
--- src/import.c
+++ src/import.c
@@ -729,10 +729,11 @@
729729
const char *zBranches; /* Name of branches folder in repo root */
730730
int lenBranches; /* String length of zBranches */
731731
const char *zTags; /* Name of tags folder in repo root */
732732
int lenTags; /* String length of zTags */
733733
Bag newBranches; /* Branches that were created in this revision */
734
+ int noSvnRevFlag; /* Omit snv-rev-nn tags on every checkins */
734735
} gsvn;
735736
typedef struct {
736737
char *zKey;
737738
char *zVal;
738739
} KeyVal;
@@ -999,24 +1000,30 @@
9991000
parentBranch
10001001
);
10011002
blob_appendf(&manifest, "P %s\n", zParentUuid);
10021003
blob_appendf(&manifest, "T *branch * %F\n", zBranch);
10031004
blob_appendf(&manifest, "T *sym-%F *\n", zBranch);
1004
- blob_appendf(&manifest, "T +sym-svn-rev-%d *\n", gsvn.rev);
1005
+ if( !gsvn.noSvnRevFlag ){
1006
+ blob_appendf(&manifest, "T +sym-svn-rev-%d *\n", gsvn.rev);
1007
+ }
10051008
blob_appendf(&manifest, "T -sym-%F *\n", zParentBranch);
10061009
fossil_free(zParentBranch);
10071010
}else{
10081011
char *zMergeUuid = rid_to_uuid(mergeRid);
10091012
blob_appendf(&manifest, "P %s %s\n", zParentUuid, zMergeUuid);
1010
- blob_appendf(&manifest, "T +sym-svn-rev-%d *\n", gsvn.rev);
1013
+ if( !gsvn.noSvnRevFlag ){
1014
+ blob_appendf(&manifest, "T +sym-svn-rev-%d *\n", gsvn.rev);
1015
+ }
10111016
fossil_free(zMergeUuid);
10121017
}
10131018
fossil_free(zParentUuid);
10141019
}else{
10151020
blob_appendf(&manifest, "T *branch * %F\n", zBranch);
10161021
blob_appendf(&manifest, "T *sym-%F *\n", zBranch);
1017
- blob_appendf(&manifest, "T +sym-svn-rev-%d *\n", gsvn.rev);
1022
+ if( !gsvn.noSvnRevFlag ){
1023
+ blob_appendf(&manifest, "T +sym-svn-rev-%d *\n", gsvn.rev);
1024
+ }
10181025
}
10191026
}else if( branchType==SVN_TAG ){
10201027
char *zParentUuid = rid_to_uuid(parentRid);
10211028
blob_reset(&manifest);
10221029
blob_appendf(&manifest, "D %s\n", gsvn.zDate);
@@ -1474,10 +1481,11 @@
14741481
** --trunk FOLDER Name of trunk folder
14751482
** --branches FOLDER Name of branches folder
14761483
** --tags FOLDER Name of tags folder
14771484
** --base PATH Path to project root in repository
14781485
** --flat The whole dump is a single branch
1486
+** --no-svn-rev Omit 'snv-rev-nnn' tags on checkins
14791487
**
14801488
** The --incremental option allows an existing repository to be extended
14811489
** with new content.
14821490
**
14831491
** Options:
@@ -1490,14 +1498,16 @@
14901498
FILE *pIn;
14911499
Stmt q;
14921500
const char *zBase = find_option("base", 0, 1);
14931501
int forceFlag = find_option("force", "f", 0)!=0;
14941502
int incrFlag = find_option("incremental", "i", 0)!=0;
1503
+ int flatFlag = find_option("flat", 0, 0)!=0;
1504
+
14951505
gsvn.zTrunk = find_option("trunk", 0, 1);
14961506
gsvn.zBranches = find_option("branches", 0, 1);
14971507
gsvn.zTags = find_option("tags", 0, 1);
1498
- int flatFlag = find_option("flat", 0, 0)!=0;
1508
+ gsvn.noSvnRevFlag = find_option("no-svn-rev", 0, 0)!=0;
14991509
15001510
verify_all_options();
15011511
if( g.argc!=4 && g.argc!=5 ){
15021512
usage("FORMAT REPOSITORY-NAME");
15031513
}
15041514
--- src/import.c
+++ src/import.c
@@ -729,10 +729,11 @@
729 const char *zBranches; /* Name of branches folder in repo root */
730 int lenBranches; /* String length of zBranches */
731 const char *zTags; /* Name of tags folder in repo root */
732 int lenTags; /* String length of zTags */
733 Bag newBranches; /* Branches that were created in this revision */
 
734 } gsvn;
735 typedef struct {
736 char *zKey;
737 char *zVal;
738 } KeyVal;
@@ -999,24 +1000,30 @@
999 parentBranch
1000 );
1001 blob_appendf(&manifest, "P %s\n", zParentUuid);
1002 blob_appendf(&manifest, "T *branch * %F\n", zBranch);
1003 blob_appendf(&manifest, "T *sym-%F *\n", zBranch);
1004 blob_appendf(&manifest, "T +sym-svn-rev-%d *\n", gsvn.rev);
 
 
1005 blob_appendf(&manifest, "T -sym-%F *\n", zParentBranch);
1006 fossil_free(zParentBranch);
1007 }else{
1008 char *zMergeUuid = rid_to_uuid(mergeRid);
1009 blob_appendf(&manifest, "P %s %s\n", zParentUuid, zMergeUuid);
1010 blob_appendf(&manifest, "T +sym-svn-rev-%d *\n", gsvn.rev);
 
 
1011 fossil_free(zMergeUuid);
1012 }
1013 fossil_free(zParentUuid);
1014 }else{
1015 blob_appendf(&manifest, "T *branch * %F\n", zBranch);
1016 blob_appendf(&manifest, "T *sym-%F *\n", zBranch);
1017 blob_appendf(&manifest, "T +sym-svn-rev-%d *\n", gsvn.rev);
 
 
1018 }
1019 }else if( branchType==SVN_TAG ){
1020 char *zParentUuid = rid_to_uuid(parentRid);
1021 blob_reset(&manifest);
1022 blob_appendf(&manifest, "D %s\n", gsvn.zDate);
@@ -1474,10 +1481,11 @@
1474 ** --trunk FOLDER Name of trunk folder
1475 ** --branches FOLDER Name of branches folder
1476 ** --tags FOLDER Name of tags folder
1477 ** --base PATH Path to project root in repository
1478 ** --flat The whole dump is a single branch
 
1479 **
1480 ** The --incremental option allows an existing repository to be extended
1481 ** with new content.
1482 **
1483 ** Options:
@@ -1490,14 +1498,16 @@
1490 FILE *pIn;
1491 Stmt q;
1492 const char *zBase = find_option("base", 0, 1);
1493 int forceFlag = find_option("force", "f", 0)!=0;
1494 int incrFlag = find_option("incremental", "i", 0)!=0;
 
 
1495 gsvn.zTrunk = find_option("trunk", 0, 1);
1496 gsvn.zBranches = find_option("branches", 0, 1);
1497 gsvn.zTags = find_option("tags", 0, 1);
1498 int flatFlag = find_option("flat", 0, 0)!=0;
1499
1500 verify_all_options();
1501 if( g.argc!=4 && g.argc!=5 ){
1502 usage("FORMAT REPOSITORY-NAME");
1503 }
1504
--- src/import.c
+++ src/import.c
@@ -729,10 +729,11 @@
729 const char *zBranches; /* Name of branches folder in repo root */
730 int lenBranches; /* String length of zBranches */
731 const char *zTags; /* Name of tags folder in repo root */
732 int lenTags; /* String length of zTags */
733 Bag newBranches; /* Branches that were created in this revision */
734 int noSvnRevFlag; /* Omit snv-rev-nn tags on every checkins */
735 } gsvn;
736 typedef struct {
737 char *zKey;
738 char *zVal;
739 } KeyVal;
@@ -999,24 +1000,30 @@
1000 parentBranch
1001 );
1002 blob_appendf(&manifest, "P %s\n", zParentUuid);
1003 blob_appendf(&manifest, "T *branch * %F\n", zBranch);
1004 blob_appendf(&manifest, "T *sym-%F *\n", zBranch);
1005 if( !gsvn.noSvnRevFlag ){
1006 blob_appendf(&manifest, "T +sym-svn-rev-%d *\n", gsvn.rev);
1007 }
1008 blob_appendf(&manifest, "T -sym-%F *\n", zParentBranch);
1009 fossil_free(zParentBranch);
1010 }else{
1011 char *zMergeUuid = rid_to_uuid(mergeRid);
1012 blob_appendf(&manifest, "P %s %s\n", zParentUuid, zMergeUuid);
1013 if( !gsvn.noSvnRevFlag ){
1014 blob_appendf(&manifest, "T +sym-svn-rev-%d *\n", gsvn.rev);
1015 }
1016 fossil_free(zMergeUuid);
1017 }
1018 fossil_free(zParentUuid);
1019 }else{
1020 blob_appendf(&manifest, "T *branch * %F\n", zBranch);
1021 blob_appendf(&manifest, "T *sym-%F *\n", zBranch);
1022 if( !gsvn.noSvnRevFlag ){
1023 blob_appendf(&manifest, "T +sym-svn-rev-%d *\n", gsvn.rev);
1024 }
1025 }
1026 }else if( branchType==SVN_TAG ){
1027 char *zParentUuid = rid_to_uuid(parentRid);
1028 blob_reset(&manifest);
1029 blob_appendf(&manifest, "D %s\n", gsvn.zDate);
@@ -1474,10 +1481,11 @@
1481 ** --trunk FOLDER Name of trunk folder
1482 ** --branches FOLDER Name of branches folder
1483 ** --tags FOLDER Name of tags folder
1484 ** --base PATH Path to project root in repository
1485 ** --flat The whole dump is a single branch
1486 ** --no-svn-rev Omit 'snv-rev-nnn' tags on checkins
1487 **
1488 ** The --incremental option allows an existing repository to be extended
1489 ** with new content.
1490 **
1491 ** Options:
@@ -1490,14 +1498,16 @@
1498 FILE *pIn;
1499 Stmt q;
1500 const char *zBase = find_option("base", 0, 1);
1501 int forceFlag = find_option("force", "f", 0)!=0;
1502 int incrFlag = find_option("incremental", "i", 0)!=0;
1503 int flatFlag = find_option("flat", 0, 0)!=0;
1504
1505 gsvn.zTrunk = find_option("trunk", 0, 1);
1506 gsvn.zBranches = find_option("branches", 0, 1);
1507 gsvn.zTags = find_option("tags", 0, 1);
1508 gsvn.noSvnRevFlag = find_option("no-svn-rev", 0, 0)!=0;
1509
1510 verify_all_options();
1511 if( g.argc!=4 && g.argc!=5 ){
1512 usage("FORMAT REPOSITORY-NAME");
1513 }
1514

Keyboard Shortcuts

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