695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
|
" origname," /* 2: original pathname. Null if not renamed */
" delta" /* 3: delta. NULL if deleted. empty is no change */
" FROM patch.chng, blob WHERE blob.uuid=patch.chng.hash"
" ORDER BY pathname"
);
while( db_step(&q)==SQLITE_ROW ){
int rid = db_column_int(&q, 0);
// const char *zOrig = db_column_text(&q, 2);
const char *zName = db_column_text(&q, 1);
int isBin1, isBin2;
Blob a, b;
if( db_column_type(&q,3)==SQLITE_NULL ){
fossil_print("DELETE %s\n", zName);
diff_print_index(zName, diffFlags, 0);
isBin2 = 0;
|
|
|
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
|
" origname," /* 2: original pathname. Null if not renamed */
" delta" /* 3: delta. NULL if deleted. empty is no change */
" FROM patch.chng, blob WHERE blob.uuid=patch.chng.hash"
" ORDER BY pathname"
);
while( db_step(&q)==SQLITE_ROW ){
int rid = db_column_int(&q, 0);
/* const char *zOrig = db_column_text(&q, 2); */
const char *zName = db_column_text(&q, 1);
int isBin1, isBin2;
Blob a, b;
if( db_column_type(&q,3)==SQLITE_NULL ){
fossil_print("DELETE %s\n", zName);
diff_print_index(zName, diffFlags, 0);
isBin2 = 0;
|
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
|
**
*/
void patch_cmd(void){
const char *zCmd;
size_t n;
if( g.argc<3 ){
patch_usage:
usage("apply|create|pull|push|view");
}
zCmd = g.argv[2];
n = strlen(zCmd);
if( strncmp(zCmd, "apply", n)==0 ){
char *zIn;
unsigned flags = 0;
if( find_option("dryrun","n",0) ) flags |= PATCH_DRYRUN;
|
|
|
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
|
**
*/
void patch_cmd(void){
const char *zCmd;
size_t n;
if( g.argc<3 ){
patch_usage:
usage("apply|create|diff|pull|push|view");
}
zCmd = g.argv[2];
n = strlen(zCmd);
if( strncmp(zCmd, "apply", n)==0 ){
char *zIn;
unsigned flags = 0;
if( find_option("dryrun","n",0) ) flags |= PATCH_DRYRUN;
|
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
|
}
diffFlags = diff_options();
if( find_option("verbose","v",0)!=0 ) diffFlags |= DIFF_VERBOSE;
if( zDiffCmd ){
zBinGlob = diff_get_binary_glob();
fIncludeBinary = diff_include_binary_files();
}
zIn = patch_find_patch_filename("apply");
db_must_be_within_tree();
verify_all_options();
patch_attach(zIn, stdin);
patch_diff( zDiffCmd, zBinGlob, fIncludeBinary, diffFlags);
fossil_free(zIn);
}else
if( strncmp(zCmd, "pull", n)==0 ){
FILE *pIn = 0;
unsigned flags = 0;
|
|
<
>
|
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
|
}
diffFlags = diff_options();
if( find_option("verbose","v",0)!=0 ) diffFlags |= DIFF_VERBOSE;
if( zDiffCmd ){
zBinGlob = diff_get_binary_glob();
fIncludeBinary = diff_include_binary_files();
}
db_find_and_open_repository(0, 0);
verify_all_options();
zIn = patch_find_patch_filename("apply");
patch_attach(zIn, stdin);
patch_diff( zDiffCmd, zBinGlob, fIncludeBinary, diffFlags);
fossil_free(zIn);
}else
if( strncmp(zCmd, "pull", n)==0 ){
FILE *pIn = 0;
unsigned flags = 0;
|