Fossil

Check-in [16923b5c]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Integrate svn-import_no-svn-rev branch..
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | svn-import
Files: files | file ages | folders
SHA1:16923b5c599218bf2170c905c1cc5fe63981e053
User & Date: mgagnon 2015-02-25 13:52:56
Context
2015-02-25
13:54
Merge trunk.. check-in: 7d0ce2b0 user: mgagnon tags: svn-import
13:52
Integrate svn-import_no-svn-rev branch.. check-in: 16923b5c user: mgagnon tags: svn-import
2015-02-22
15:59
merge compiler fix for msvc.. Closed-Leaf check-in: 44686ca1 user: mgagnon tags: svn-import_no-svn-rev
15:35
Compiler warning (cherry-picked from "svn-import_no-svn-rev" branch) check-in: 998ba3ad user: jan.nijtmans tags: svn-import
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/import.c.

727
728
729
730
731
732
733

734
735
736
737
738
739
740
...
997
998
999
1000
1001
1002
1003

1004

1005
1006
1007
1008
1009

1010

1011
1012
1013
1014
1015
1016

1017

1018
1019
1020
1021
1022
1023
1024
....
1476
1477
1478
1479
1480
1481
1482

1483
1484
1485
1486
1487
1488
1489
....
1497
1498
1499
1500
1501
1502
1503


1504
1505
1506
1507
1508
1509
1510
  const char *zTrunk;         /* Name of trunk folder in repo root */
  int lenTrunk;               /* String length of zTrunk */
  const char *zBranches;      /* Name of branches folder in repo root */
  int lenBranches;            /* String length of zBranches */
  const char *zTags;          /* Name of tags folder in repo root */
  int lenTags;                /* String length of zTags */
  Bag newBranches;            /* Branches that were created in this revision */

} gsvn;
typedef struct {
  char *zKey;
  char *zVal;
} KeyVal;
typedef struct {
  KeyVal *aHeaders;
................................................................................
            char *zParentBranch =
              db_text(0, "SELECT tname FROM xbranches WHERE tid=%d",
                      parentBranch
              );
            blob_appendf(&manifest, "P %s\n", zParentUuid);
            blob_appendf(&manifest, "T *branch * %F\n", zBranch);
            blob_appendf(&manifest, "T *sym-%F *\n", zBranch);

            blob_appendf(&manifest, "T +sym-svn-rev-%d *\n", gsvn.rev);

            blob_appendf(&manifest, "T -sym-%F *\n", zParentBranch);
            fossil_free(zParentBranch);
          }else{
            char *zMergeUuid = rid_to_uuid(mergeRid);
            blob_appendf(&manifest, "P %s %s\n", zParentUuid, zMergeUuid);

            blob_appendf(&manifest, "T +sym-svn-rev-%d *\n", gsvn.rev);

            fossil_free(zMergeUuid);
          }
          fossil_free(zParentUuid);
        }else{
          blob_appendf(&manifest, "T *branch * %F\n", zBranch);
          blob_appendf(&manifest, "T *sym-%F *\n", zBranch);

          blob_appendf(&manifest, "T +sym-svn-rev-%d *\n", gsvn.rev);

        }
      }else if( branchType==SVN_TAG ){
        char *zParentUuid = rid_to_uuid(parentRid);
        blob_reset(&manifest);
        blob_appendf(&manifest, "D %s\n", gsvn.zDate);
        blob_appendf(&manifest, "T +sym-%F %s\n", zBranch, zParentUuid);
        fossil_free(zParentUuid);
................................................................................
**                and tags/
**                Options:
**                  --trunk FOLDER     Name of trunk folder
**                  --branches FOLDER  Name of branches folder
**                  --tags FOLDER      Name of tags folder
**                  --base PATH        Path to project root in repository
**                  --flat             The whole dump is a single branch

**
** The --incremental option allows an existing repository to be extended
** with new content.
**
** Options:
**   --incremental  allow importing into an existing repository
**
................................................................................
  int forceFlag = find_option("force", "f", 0)!=0;
  int incrFlag = find_option("incremental", "i", 0)!=0;
  int flatFlag = find_option("flat", 0, 0)!=0;

  gsvn.zTrunk = find_option("trunk", 0, 1);
  gsvn.zBranches = find_option("branches", 0, 1);
  gsvn.zTags = find_option("tags", 0, 1);


  verify_all_options();
  if( g.argc!=4  && g.argc!=5 ){
    usage("FORMAT REPOSITORY-NAME");
  }
  if( g.argc==5 ){
    pIn = fossil_fopen(g.argv[4], "rb");
  }else{







>







 







>
|
>





>
|
>






>
|
>







 







>







 







>
>







727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
...
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
....
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
....
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
  const char *zTrunk;         /* Name of trunk folder in repo root */
  int lenTrunk;               /* String length of zTrunk */
  const char *zBranches;      /* Name of branches folder in repo root */
  int lenBranches;            /* String length of zBranches */
  const char *zTags;          /* Name of tags folder in repo root */
  int lenTags;                /* String length of zTags */
  Bag newBranches;            /* Branches that were created in this revision */
  int noSvnRevFlag;           /* Omit snv-rev-nn tags on every checkins */
} gsvn;
typedef struct {
  char *zKey;
  char *zVal;
} KeyVal;
typedef struct {
  KeyVal *aHeaders;
................................................................................
            char *zParentBranch =
              db_text(0, "SELECT tname FROM xbranches WHERE tid=%d",
                      parentBranch
              );
            blob_appendf(&manifest, "P %s\n", zParentUuid);
            blob_appendf(&manifest, "T *branch * %F\n", zBranch);
            blob_appendf(&manifest, "T *sym-%F *\n", zBranch);
            if( !gsvn.noSvnRevFlag ){
              blob_appendf(&manifest, "T +sym-svn-rev-%d *\n", gsvn.rev);
            }
            blob_appendf(&manifest, "T -sym-%F *\n", zParentBranch);
            fossil_free(zParentBranch);
          }else{
            char *zMergeUuid = rid_to_uuid(mergeRid);
            blob_appendf(&manifest, "P %s %s\n", zParentUuid, zMergeUuid);
            if( !gsvn.noSvnRevFlag ){
              blob_appendf(&manifest, "T +sym-svn-rev-%d *\n", gsvn.rev);
            }
            fossil_free(zMergeUuid);
          }
          fossil_free(zParentUuid);
        }else{
          blob_appendf(&manifest, "T *branch * %F\n", zBranch);
          blob_appendf(&manifest, "T *sym-%F *\n", zBranch);
          if( !gsvn.noSvnRevFlag ){
            blob_appendf(&manifest, "T +sym-svn-rev-%d *\n", gsvn.rev);
          }
        }
      }else if( branchType==SVN_TAG ){
        char *zParentUuid = rid_to_uuid(parentRid);
        blob_reset(&manifest);
        blob_appendf(&manifest, "D %s\n", gsvn.zDate);
        blob_appendf(&manifest, "T +sym-%F %s\n", zBranch, zParentUuid);
        fossil_free(zParentUuid);
................................................................................
**                and tags/
**                Options:
**                  --trunk FOLDER     Name of trunk folder
**                  --branches FOLDER  Name of branches folder
**                  --tags FOLDER      Name of tags folder
**                  --base PATH        Path to project root in repository
**                  --flat             The whole dump is a single branch
**                  --no-svn-rev       Omit 'snv-rev-nnn' tags on checkins
**
** The --incremental option allows an existing repository to be extended
** with new content.
**
** Options:
**   --incremental  allow importing into an existing repository
**
................................................................................
  int forceFlag = find_option("force", "f", 0)!=0;
  int incrFlag = find_option("incremental", "i", 0)!=0;
  int flatFlag = find_option("flat", 0, 0)!=0;

  gsvn.zTrunk = find_option("trunk", 0, 1);
  gsvn.zBranches = find_option("branches", 0, 1);
  gsvn.zTags = find_option("tags", 0, 1);
  gsvn.noSvnRevFlag = find_option("no-svn-rev", 0, 0)!=0;

  verify_all_options();
  if( g.argc!=4  && g.argc!=5 ){
    usage("FORMAT REPOSITORY-NAME");
  }
  if( g.argc==5 ){
    pIn = fossil_fopen(g.argv[4], "rb");
  }else{