Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch extended_ci_names Excluding Merge-Ins
This is equivalent to a diff from 0a7ab3ccb0 to 9fe787ec03
2011-10-14
| ||
16:12 | Merging the extended_ci_names branch, that introduces more ways of naming checkins in diff and update operations. check-in: 107e605f41 user: viriketo tags: declined | |
2011-10-13
| ||
23:48 | Started adding support for showing side-by-side diffs in the web ui. check-in: a6a8e89413 user: jan tags: jan-sbsdiff | |
12:56 | Fixing the usage() calls in stash.c, as it duplicated the word stash; it was giving messags like "Usage: fossil stash stash pop". check-in: 399c0ddae4 user: viriketo tags: trunk | |
02:47 | Create new branch named "ashish-ipv6" check-in: 10e1071461 user: ashish tags: ashish-ipv6 | |
2011-10-12
| ||
17:41 | Adding a more options at naming commits for diff and update commands. I wrote a new function that allows more kind of specifications for a checkin uuid: checkout, parent and pivot:id1:id2. If there was a way to discover the 'parent branch' of the current checkout, there could be a 'parentbranch' naming too. I think this makes the life ea... Closed-Leaf check-in: 9fe787ec03 user: viriketo tags: extended_ci_names | |
16:20 | Fixing the merge_renames test, so it accepts being called out of a repository. The message given by fossil when trying 'info' out of a repository had changed. check-in: 0a7ab3ccb0 user: viriketo tags: trunk | |
15:21 | Making the http ssl code output the verification error, in case of verification failure. I also make the user question state the host the certificate is related to. check-in: 79c31f9b73 user: viriketo tags: trunk | |
Changes to src/diffcmd.c.
181 181 } 182 182 183 183 /* 184 184 ** Do a diff against a single file named in zFileTreeName from version zFrom 185 185 ** against the same file on disk. 186 186 */ 187 187 static void diff_one_against_disk( 188 - const char *zFrom, /* Name of file */ 188 + const char *zFrom, /* Version to difference from */ 189 189 const char *zDiffCmd, /* Use this "diff" command */ 190 190 int ignoreEolWs, /* Ignore whitespace changes at end of lines */ 191 - const char *zFileTreeName 191 + const char *zFileTreeName /* Name of file */ 192 192 ){ 193 193 Blob fname; 194 194 Blob content; 195 195 int isLink; 196 196 file_tree_name(zFileTreeName, &fname, 1); 197 197 historical_version_of_file(zFrom, blob_str(&fname), &content, &isLink, 0, 0); 198 198 if( !isLink != !file_wd_islink(zFrom) ){ ................................................................................ 223 223 ignoreEolWs = (diffFlags & DIFF_NOEOLWS)!=0; 224 224 asNewFile = (diffFlags & DIFF_NEWFILE)!=0; 225 225 vid = db_lget_int("checkout", 0); 226 226 vfile_check_signature(vid, 1, 0); 227 227 blob_zero(&sql); 228 228 db_begin_transaction(); 229 229 if( zFrom ){ 230 - int rid = name_to_typed_rid(zFrom, "ci"); 230 + int rid = extended_ci_name_to_rid(zFrom); 231 231 if( !is_a_version(rid) ){ 232 232 fossil_fatal("no such check-in: %s", zFrom); 233 233 } 234 234 load_vfile_from_rid(rid); 235 235 blob_appendf(&sql, 236 236 "SELECT v2.pathname, v2.deleted, v2.chnged, v2.rid==0, v1.rid, v1.islink" 237 237 " FROM vfile v1, vfile v2 "
Changes to src/manifest.c.
936 936 ** Given a checkin name, load and parse the manifest for that checkin. 937 937 ** Throw a fatal error if anything goes wrong. 938 938 */ 939 939 Manifest *manifest_get_by_name(const char *zName, int *pRid){ 940 940 int rid; 941 941 Manifest *p; 942 942 943 - rid = name_to_typed_rid(zName, "ci"); 943 + rid = extended_ci_name_to_rid(zName); 944 944 if( !is_a_version(rid) ){ 945 945 fossil_fatal("no such checkin: %s", zName); 946 946 } 947 947 if( pRid ) *pRid = rid; 948 948 p = manifest_get(rid, CFTYPE_MANIFEST); 949 949 if( p==0 ){ 950 950 fossil_fatal("cannot parse manifest for checkin: %s", zName);
Changes to src/name.c.
385 385 }else if( rc==2 ){ 386 386 cgi_redirectf("%s/ambiguous/%T?src=%t", g.zTop, zName, g.zPath); 387 387 return 0; 388 388 }else{ 389 389 rid = db_int(0, "SELECT rid FROM blob WHERE uuid=%B", &name); 390 390 blob_reset(&name); 391 391 } 392 + return rid; 393 +} 394 + 395 + 396 +/* 397 +** Similar to name_to_typed_rid(zName, "ci"), 398 +** but it accepts more variants for the name. The additional variants are: 399 +** 400 +** checkout The current checkout 401 +** parent The parent of the current checkout 402 +** pivot:id1:id2 The pivot between id1 and id2 403 +** 404 +** It should allow easier naming of checkins, both in 'diff' and 'update' 405 +** commands for example. 406 +*/ 407 +int extended_ci_name_to_rid(const char *zName){ 408 + int rid; 409 + 410 + rid = db_lget_int("checkout", 0); 411 + 412 + if( fossil_strcmp(zName, "checkout")==0 ){ 413 + rid = db_lget_int("checkout", 0); 414 + } 415 + else if( fossil_strcmp(zName, "parent")==0 ){ 416 + int cid; 417 + cid = db_lget_int("checkout", 0); 418 + if (cid == 0) 419 + fossil_fatal("cannot find current checkout version"); 420 + rid = db_int(0, "SELECT pid FROM plink WHERE cid=%d", cid); 421 + if (rid == 0) 422 + fossil_fatal("cannot find the parent of the current checkout version"); 423 + } 424 + else if( strlen(zName) > 6 && memcmp(zName, "pivot:", 6)==0 ){ 425 + /* This conflicts with 'tag:', but I don't know a better char than : */ 426 + const char *zPair = zName + 6; 427 + char *zIdName; 428 + int rid1, rid2; 429 + char *zPair2 = strdup(zPair); /* Just for constness and strtok */ 430 + 431 + zIdName = strtok(zPair2,":"); 432 + 433 + if (!zIdName) 434 + fossil_fatal("Cannot parse pivot#checkin1#checkin2"); 435 + rid1 = name_to_typed_rid(zIdName, "ci"); 436 + if (rid1 == 0) 437 + fossil_fatal("Cannot find the check-in %s", zIdName); 438 + 439 + zIdName = strtok(NULL,":"); 440 + rid2 = name_to_typed_rid(zIdName, "ci"); 441 + 442 + pivot_set_primary(rid1); 443 + pivot_set_secondary(rid2); 444 + rid = pivot_find(); 445 + 446 + if (rid == 0) 447 + fossil_fatal("Cannot find the pivot of %s", zName); 448 + 449 + free(zPair2); 450 + } 451 + else{ 452 + rid = name_to_typed_rid(zName, "ci"); 453 + } 454 + 392 455 return rid; 393 456 }
Changes to src/update.c.
129 129 ** target as if VERSION were omitted. */ 130 130 }else if( fossil_strcmp(g.argv[2], "latest")==0 ){ 131 131 /* If VERSION is "latest", then use the same algorithm to find the 132 132 ** target as if VERSION were omitted and the --latest flag is present. 133 133 */ 134 134 latestFlag = 1; 135 135 }else{ 136 - tid = name_to_typed_rid(g.argv[2],"ci"); 136 + tid = extended_ci_name_to_rid(g.argv[2]); 137 137 if( tid==0 ){ 138 138 fossil_fatal("no such version: %s", g.argv[2]); 139 139 }else if( !is_a_version(tid) ){ 140 140 fossil_fatal("no such version: %s", g.argv[2]); 141 141 } 142 142 } 143 143 } ................................................................................ 551 551 int errCode /* Error code if file not found. Panic if 0. */ 552 552 ){ 553 553 Manifest *pManifest; 554 554 ManifestFile *pFile; 555 555 int rid=0; 556 556 557 557 if( revision ){ 558 - rid = name_to_typed_rid(revision,"ci"); 558 + rid = extended_ci_name_to_rid(revision); 559 559 }else{ 560 560 rid = db_lget_int("checkout", 0); 561 561 } 562 562 if( !is_a_version(rid) ){ 563 563 if( errCode>0 ) return errCode; 564 564 fossil_fatal("no such checkin: %s", revision); 565 565 }