Fossil SCM

Remove the isFrom field from the ImportFile structure.

isaac.jurado 2013-06-25 20:21 git-better-import
Commit 659825067f184caa113cf57be891bd79dd789036
1 file changed +6 -14
+6 -14
--- src/import.c
+++ src/import.c
@@ -28,11 +28,10 @@
2828
*/
2929
struct ImportFile {
3030
char *zName; /* Name of a file */
3131
char *zUuid; /* UUID of the file */
3232
char *zPrior; /* Prior name if the name was changed */
33
- char isFrom; /* True if obtained from the parent */
3433
char isExe; /* True if executable */
3534
char isLink; /* True if symlink */
3635
};
3736
#endif
3837
@@ -434,11 +433,10 @@
434433
pNew = import_add_file();
435434
pNew->zName = fossil_strdup(pOld->zName);
436435
pNew->isExe = pOld->zPerm && strstr(pOld->zPerm, "x")!=0;
437436
pNew->isLink = pOld->zPerm && strstr(pOld->zPerm, "l")!=0;
438437
pNew->zUuid = fossil_strdup(pOld->zUuid);
439
- pNew->isFrom = 1;
440438
}
441439
manifest_destroy(p);
442440
}
443441
444442
/*
@@ -630,63 +628,57 @@
630628
}
631629
pFile->isExe = (fossil_strcmp(zPerm, "100755")==0);
632630
pFile->isLink = (fossil_strcmp(zPerm, "120000")==0);
633631
fossil_free(pFile->zUuid);
634632
pFile->zUuid = resolve_committish(zUuid);
635
- pFile->isFrom = 0;
636633
}else
637634
if( memcmp(zLine, "D ", 2)==0 ){
638635
import_prior_files();
639636
z = &zLine[2];
640637
zName = rest_of_line(&z);
641638
dequote_git_filename(zName);
642639
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 ){
645642
fossil_free(pFile->zName);
646643
fossil_free(pFile->zPrior);
647644
pFile->zPrior = 0;
648645
fossil_free(pFile->zUuid);
649646
*pFile = gg.aFile[--gg.nFile];
650
- i--;
651647
}
652648
}else
653649
if( memcmp(zLine, "C ", 2)==0 ){
654650
int nFrom;
655651
import_prior_files();
656652
z = &zLine[2];
657653
zFrom = next_token(&z);
658654
zTo = rest_of_line(&z);
659655
i = 0;
660
- mx = gg.nFile;
661656
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 ){
663659
pNew = import_add_file();
664
- pFile = &gg.aFile[i-1];
665660
if( strlen(pFile->zName)>nFrom ){
666661
pNew->zName = mprintf("%s%s", zTo, pFile->zName[nFrom]);
667662
}else{
668663
pNew->zName = fossil_strdup(zTo);
669664
}
670665
pNew->isExe = pFile->isExe;
671666
pNew->isLink = pFile->isLink;
672667
pNew->zUuid = fossil_strdup(pFile->zUuid);
673
- pNew->isFrom = 0;
674668
}
675669
}else
676670
if( memcmp(zLine, "R ", 2)==0 ){
677671
import_prior_files();
678672
z = &zLine[2];
679673
zFrom = next_token(&z);
680674
zTo = rest_of_line(&z);
681675
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 ){
685678
pFile->zPrior = pFile->zName;
686679
pFile->zName = fossil_strdup(zTo);
687
- pFile->isFrom = 0;
688680
}
689681
}else
690682
if( memcmp(zLine, "deleteall", 9)==0 ){
691683
gg.fromLoaded = 1;
692684
}else
693685
--- 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

Keyboard Shortcuts

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