Fossil SCM
Remove the isFrom field from the ImportFile structure.
Commit
659825067f184caa113cf57be891bd79dd789036
Parent
b0268d9856a0bef…
1 file changed
+6
-14
+6
-14
| --- src/import.c | ||
| +++ src/import.c | ||
| @@ -28,11 +28,10 @@ | ||
| 28 | 28 | */ |
| 29 | 29 | struct ImportFile { |
| 30 | 30 | char *zName; /* Name of a file */ |
| 31 | 31 | char *zUuid; /* UUID of the file */ |
| 32 | 32 | char *zPrior; /* Prior name if the name was changed */ |
| 33 | - char isFrom; /* True if obtained from the parent */ | |
| 34 | 33 | char isExe; /* True if executable */ |
| 35 | 34 | char isLink; /* True if symlink */ |
| 36 | 35 | }; |
| 37 | 36 | #endif |
| 38 | 37 | |
| @@ -434,11 +433,10 @@ | ||
| 434 | 433 | pNew = import_add_file(); |
| 435 | 434 | pNew->zName = fossil_strdup(pOld->zName); |
| 436 | 435 | pNew->isExe = pOld->zPerm && strstr(pOld->zPerm, "x")!=0; |
| 437 | 436 | pNew->isLink = pOld->zPerm && strstr(pOld->zPerm, "l")!=0; |
| 438 | 437 | pNew->zUuid = fossil_strdup(pOld->zUuid); |
| 439 | - pNew->isFrom = 1; | |
| 440 | 438 | } |
| 441 | 439 | manifest_destroy(p); |
| 442 | 440 | } |
| 443 | 441 | |
| 444 | 442 | /* |
| @@ -630,63 +628,57 @@ | ||
| 630 | 628 | } |
| 631 | 629 | pFile->isExe = (fossil_strcmp(zPerm, "100755")==0); |
| 632 | 630 | pFile->isLink = (fossil_strcmp(zPerm, "120000")==0); |
| 633 | 631 | fossil_free(pFile->zUuid); |
| 634 | 632 | pFile->zUuid = resolve_committish(zUuid); |
| 635 | - pFile->isFrom = 0; | |
| 636 | 633 | }else |
| 637 | 634 | if( memcmp(zLine, "D ", 2)==0 ){ |
| 638 | 635 | import_prior_files(); |
| 639 | 636 | z = &zLine[2]; |
| 640 | 637 | zName = rest_of_line(&z); |
| 641 | 638 | dequote_git_filename(zName); |
| 642 | 639 | i = 0; |
| 643 | - while( (pFile = import_find_file(zName, &i, gg.nFile))!=0 ){ | |
| 644 | - if( pFile->isFrom==0 ) continue; | |
| 640 | + pFile = import_find_file(zName, &i, gg.nFile); | |
| 641 | + if( pFile!=0 ){ | |
| 645 | 642 | fossil_free(pFile->zName); |
| 646 | 643 | fossil_free(pFile->zPrior); |
| 647 | 644 | pFile->zPrior = 0; |
| 648 | 645 | fossil_free(pFile->zUuid); |
| 649 | 646 | *pFile = gg.aFile[--gg.nFile]; |
| 650 | - i--; | |
| 651 | 647 | } |
| 652 | 648 | }else |
| 653 | 649 | if( memcmp(zLine, "C ", 2)==0 ){ |
| 654 | 650 | int nFrom; |
| 655 | 651 | import_prior_files(); |
| 656 | 652 | z = &zLine[2]; |
| 657 | 653 | zFrom = next_token(&z); |
| 658 | 654 | zTo = rest_of_line(&z); |
| 659 | 655 | i = 0; |
| 660 | - mx = gg.nFile; | |
| 661 | 656 | nFrom = strlen(zFrom); |
| 662 | - while( (pFile = import_find_file(zFrom, &i, mx))!=0 ){ | |
| 657 | + pFile = import_find_file(zFrom, &i, gg.nFile); | |
| 658 | + if( pFile!=0 ){ | |
| 663 | 659 | pNew = import_add_file(); |
| 664 | - pFile = &gg.aFile[i-1]; | |
| 665 | 660 | if( strlen(pFile->zName)>nFrom ){ |
| 666 | 661 | pNew->zName = mprintf("%s%s", zTo, pFile->zName[nFrom]); |
| 667 | 662 | }else{ |
| 668 | 663 | pNew->zName = fossil_strdup(zTo); |
| 669 | 664 | } |
| 670 | 665 | pNew->isExe = pFile->isExe; |
| 671 | 666 | pNew->isLink = pFile->isLink; |
| 672 | 667 | pNew->zUuid = fossil_strdup(pFile->zUuid); |
| 673 | - pNew->isFrom = 0; | |
| 674 | 668 | } |
| 675 | 669 | }else |
| 676 | 670 | if( memcmp(zLine, "R ", 2)==0 ){ |
| 677 | 671 | import_prior_files(); |
| 678 | 672 | z = &zLine[2]; |
| 679 | 673 | zFrom = next_token(&z); |
| 680 | 674 | zTo = rest_of_line(&z); |
| 681 | 675 | i = 0; |
| 682 | - while( (pFile = import_find_file(zFrom, &i, gg.nFile))!=0 ){ | |
| 683 | - if( pFile->isFrom==0 ) continue; | |
| 684 | - pFile = &gg.aFile[i-1]; | |
| 676 | + pFile = import_find_file(zFrom, &i, gg.nFile); | |
| 677 | + if( pFile!=0 ){ | |
| 685 | 678 | pFile->zPrior = pFile->zName; |
| 686 | 679 | pFile->zName = fossil_strdup(zTo); |
| 687 | - pFile->isFrom = 0; | |
| 688 | 680 | } |
| 689 | 681 | }else |
| 690 | 682 | if( memcmp(zLine, "deleteall", 9)==0 ){ |
| 691 | 683 | gg.fromLoaded = 1; |
| 692 | 684 | }else |
| 693 | 685 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -28,11 +28,10 @@ | |
| 28 | */ |
| 29 | struct ImportFile { |
| 30 | char *zName; /* Name of a file */ |
| 31 | char *zUuid; /* UUID of the file */ |
| 32 | char *zPrior; /* Prior name if the name was changed */ |
| 33 | char isFrom; /* True if obtained from the parent */ |
| 34 | char isExe; /* True if executable */ |
| 35 | char isLink; /* True if symlink */ |
| 36 | }; |
| 37 | #endif |
| 38 | |
| @@ -434,11 +433,10 @@ | |
| 434 | pNew = import_add_file(); |
| 435 | pNew->zName = fossil_strdup(pOld->zName); |
| 436 | pNew->isExe = pOld->zPerm && strstr(pOld->zPerm, "x")!=0; |
| 437 | pNew->isLink = pOld->zPerm && strstr(pOld->zPerm, "l")!=0; |
| 438 | pNew->zUuid = fossil_strdup(pOld->zUuid); |
| 439 | pNew->isFrom = 1; |
| 440 | } |
| 441 | manifest_destroy(p); |
| 442 | } |
| 443 | |
| 444 | /* |
| @@ -630,63 +628,57 @@ | |
| 630 | } |
| 631 | pFile->isExe = (fossil_strcmp(zPerm, "100755")==0); |
| 632 | pFile->isLink = (fossil_strcmp(zPerm, "120000")==0); |
| 633 | fossil_free(pFile->zUuid); |
| 634 | pFile->zUuid = resolve_committish(zUuid); |
| 635 | pFile->isFrom = 0; |
| 636 | }else |
| 637 | if( memcmp(zLine, "D ", 2)==0 ){ |
| 638 | import_prior_files(); |
| 639 | z = &zLine[2]; |
| 640 | zName = rest_of_line(&z); |
| 641 | dequote_git_filename(zName); |
| 642 | i = 0; |
| 643 | while( (pFile = import_find_file(zName, &i, gg.nFile))!=0 ){ |
| 644 | if( pFile->isFrom==0 ) continue; |
| 645 | fossil_free(pFile->zName); |
| 646 | fossil_free(pFile->zPrior); |
| 647 | pFile->zPrior = 0; |
| 648 | fossil_free(pFile->zUuid); |
| 649 | *pFile = gg.aFile[--gg.nFile]; |
| 650 | i--; |
| 651 | } |
| 652 | }else |
| 653 | if( memcmp(zLine, "C ", 2)==0 ){ |
| 654 | int nFrom; |
| 655 | import_prior_files(); |
| 656 | z = &zLine[2]; |
| 657 | zFrom = next_token(&z); |
| 658 | zTo = rest_of_line(&z); |
| 659 | i = 0; |
| 660 | mx = gg.nFile; |
| 661 | nFrom = strlen(zFrom); |
| 662 | while( (pFile = import_find_file(zFrom, &i, mx))!=0 ){ |
| 663 | pNew = import_add_file(); |
| 664 | pFile = &gg.aFile[i-1]; |
| 665 | if( strlen(pFile->zName)>nFrom ){ |
| 666 | pNew->zName = mprintf("%s%s", zTo, pFile->zName[nFrom]); |
| 667 | }else{ |
| 668 | pNew->zName = fossil_strdup(zTo); |
| 669 | } |
| 670 | pNew->isExe = pFile->isExe; |
| 671 | pNew->isLink = pFile->isLink; |
| 672 | pNew->zUuid = fossil_strdup(pFile->zUuid); |
| 673 | pNew->isFrom = 0; |
| 674 | } |
| 675 | }else |
| 676 | if( memcmp(zLine, "R ", 2)==0 ){ |
| 677 | import_prior_files(); |
| 678 | z = &zLine[2]; |
| 679 | zFrom = next_token(&z); |
| 680 | zTo = rest_of_line(&z); |
| 681 | i = 0; |
| 682 | while( (pFile = import_find_file(zFrom, &i, gg.nFile))!=0 ){ |
| 683 | if( pFile->isFrom==0 ) continue; |
| 684 | pFile = &gg.aFile[i-1]; |
| 685 | pFile->zPrior = pFile->zName; |
| 686 | pFile->zName = fossil_strdup(zTo); |
| 687 | pFile->isFrom = 0; |
| 688 | } |
| 689 | }else |
| 690 | if( memcmp(zLine, "deleteall", 9)==0 ){ |
| 691 | gg.fromLoaded = 1; |
| 692 | }else |
| 693 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -28,11 +28,10 @@ | |
| 28 | */ |
| 29 | struct ImportFile { |
| 30 | char *zName; /* Name of a file */ |
| 31 | char *zUuid; /* UUID of the file */ |
| 32 | char *zPrior; /* Prior name if the name was changed */ |
| 33 | char isExe; /* True if executable */ |
| 34 | char isLink; /* True if symlink */ |
| 35 | }; |
| 36 | #endif |
| 37 | |
| @@ -434,11 +433,10 @@ | |
| 433 | pNew = import_add_file(); |
| 434 | pNew->zName = fossil_strdup(pOld->zName); |
| 435 | pNew->isExe = pOld->zPerm && strstr(pOld->zPerm, "x")!=0; |
| 436 | pNew->isLink = pOld->zPerm && strstr(pOld->zPerm, "l")!=0; |
| 437 | pNew->zUuid = fossil_strdup(pOld->zUuid); |
| 438 | } |
| 439 | manifest_destroy(p); |
| 440 | } |
| 441 | |
| 442 | /* |
| @@ -630,63 +628,57 @@ | |
| 628 | } |
| 629 | pFile->isExe = (fossil_strcmp(zPerm, "100755")==0); |
| 630 | pFile->isLink = (fossil_strcmp(zPerm, "120000")==0); |
| 631 | fossil_free(pFile->zUuid); |
| 632 | pFile->zUuid = resolve_committish(zUuid); |
| 633 | }else |
| 634 | if( memcmp(zLine, "D ", 2)==0 ){ |
| 635 | import_prior_files(); |
| 636 | z = &zLine[2]; |
| 637 | zName = rest_of_line(&z); |
| 638 | dequote_git_filename(zName); |
| 639 | i = 0; |
| 640 | pFile = import_find_file(zName, &i, gg.nFile); |
| 641 | if( pFile!=0 ){ |
| 642 | fossil_free(pFile->zName); |
| 643 | fossil_free(pFile->zPrior); |
| 644 | pFile->zPrior = 0; |
| 645 | fossil_free(pFile->zUuid); |
| 646 | *pFile = gg.aFile[--gg.nFile]; |
| 647 | } |
| 648 | }else |
| 649 | if( memcmp(zLine, "C ", 2)==0 ){ |
| 650 | int nFrom; |
| 651 | import_prior_files(); |
| 652 | z = &zLine[2]; |
| 653 | zFrom = next_token(&z); |
| 654 | zTo = rest_of_line(&z); |
| 655 | i = 0; |
| 656 | nFrom = strlen(zFrom); |
| 657 | pFile = import_find_file(zFrom, &i, gg.nFile); |
| 658 | if( pFile!=0 ){ |
| 659 | pNew = import_add_file(); |
| 660 | if( strlen(pFile->zName)>nFrom ){ |
| 661 | pNew->zName = mprintf("%s%s", zTo, pFile->zName[nFrom]); |
| 662 | }else{ |
| 663 | pNew->zName = fossil_strdup(zTo); |
| 664 | } |
| 665 | pNew->isExe = pFile->isExe; |
| 666 | pNew->isLink = pFile->isLink; |
| 667 | pNew->zUuid = fossil_strdup(pFile->zUuid); |
| 668 | } |
| 669 | }else |
| 670 | if( memcmp(zLine, "R ", 2)==0 ){ |
| 671 | import_prior_files(); |
| 672 | z = &zLine[2]; |
| 673 | zFrom = next_token(&z); |
| 674 | zTo = rest_of_line(&z); |
| 675 | i = 0; |
| 676 | pFile = import_find_file(zFrom, &i, gg.nFile); |
| 677 | if( pFile!=0 ){ |
| 678 | pFile->zPrior = pFile->zName; |
| 679 | pFile->zName = fossil_strdup(zTo); |
| 680 | } |
| 681 | }else |
| 682 | if( memcmp(zLine, "deleteall", 9)==0 ){ |
| 683 | gg.fromLoaded = 1; |
| 684 | }else |
| 685 |