Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Merge the status command into the changes command. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | andygoth-changes |
Files: | files | file ages | folders |
SHA1: |
2c3a108c72e7d596aa7ee3a653784d75 |
User & Date: | andygoth 2016-11-05 23:11:36.709 |
Context
2016-11-06
| ||
02:35 | Fold print_changes() into status_cmd() (formerly changes_cmd()). Remove C_SHA1SUM, C_HEADER, and C_VERBOSE flags which are no longer needed for communicating options to print_changes(). Move locate_unmanaged_files() closer to the top of the file so status_cmd() can call it. Implement C_UNMODIFIED and C_EXTRA in status_report(). Document the fact that the changes and status commands take optional path arguments. Let changes and status commands accept --case-sensitive (was already done), --dotfiles, and --ignore for the benefit of --extras. Incorporate search for extra files into status_cmd(). ... (check-in: f15d20e3 user: andygoth tags: andygoth-changes) | |
2016-11-05
| ||
23:11 | Merge the status command into the changes command. ... (check-in: 2c3a108c user: andygoth tags: andygoth-changes) | |
22:41 | Add TODO: reimplement ls and extras in terms of status_report() ... (check-in: 442a3cd5 user: andygoth tags: andygoth-changes) | |
Changes
Changes to src/checkin.c.
︙ | ︙ | |||
264 265 266 267 268 269 270 271 | } blob_write_to_file(&report, "-"); blob_reset(&report); } /* ** COMMAND: changes ** | > | > > > > > > | 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 | } blob_write_to_file(&report, "-"); blob_reset(&report); } /* ** COMMAND: changes ** COMMAND: status ** ** Usage: %fossil changes|status ?OPTIONS? ** ** Report the change status of files in the current checkout. ** ** The status command is similar to the changes command, except it lacks ** several of the options supported by changes and it has its own header ** and footer information. The header information is a subset of that ** shown by the info command, and the footer shows if there are any forks. ** Change type classification is always enabled for the status command. ** ** Each line of output is the name of a changed file, with paths shown ** according to the "relative-paths" setting, unless overridden by the ** --abs-paths or --rel-paths options. ** ** By default, all changed files are selected for display. This behavior ** can be overridden by using one or more filter options (listed below), |
︙ | ︙ | |||
309 310 311 312 313 314 315 316 317 318 319 320 321 322 | ** ** General options: ** --abs-paths Display absolute pathnames. ** --rel-paths Display pathnames relative to the current working ** directory. ** --sha1sum Verify file status using SHA1 hashing rather than ** relying on file mtimes. ** --header Identify the repository if report is non-empty. ** -v|--verbose Say "(none)" if the change report is empty. ** --classify Start each line with the file's change type. ** --no-classify Do not print file change types. ** ** Filter options: ** --edited Display edited, merged, and conflicted files. | > > | 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 | ** ** General options: ** --abs-paths Display absolute pathnames. ** --rel-paths Display pathnames relative to the current working ** directory. ** --sha1sum Verify file status using SHA1 hashing rather than ** relying on file mtimes. ** ** Options specific to the changes command: ** --header Identify the repository if report is non-empty. ** -v|--verbose Say "(none)" if the change report is empty. ** --classify Start each line with the file's change type. ** --no-classify Do not print file change types. ** ** Filter options: ** --edited Display edited, merged, and conflicted files. |
︙ | ︙ | |||
330 331 332 333 334 335 336 | ** --meta Display files with metadata changes. ** --unmodified Display unmodified files. ** --all Display all managed files, i.e. all of the above. ** --extra Display unmanaged files. ** --merge Display merge contributors. ** --no-merge Do not display merge contributors. ** | | | > | | | | | | | | | | > | > | | > | > | > < < | < < < < < < < < < < < < < < < < < < < < < < < | < < < < < < < < < < < < < < < | | | | | | < | | | | > > > > > > | > | 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 | ** --meta Display files with metadata changes. ** --unmodified Display unmodified files. ** --all Display all managed files, i.e. all of the above. ** --extra Display unmanaged files. ** --merge Display merge contributors. ** --no-merge Do not display merge contributors. ** ** See also: extras, ls */ void status_cmd(void){ /* Affirmative and negative flag option tables. */ static const struct { const char *option; unsigned mask; int changesOnly; } flagDefs[] = { {"edited" , C_EDITED , 0}, {"updated" , C_UPDATED , 0}, {"changed" , C_CHANGED, 0}, {"missing" , C_MISSING , 0}, {"added" , C_ADDED , 0}, {"deleted" , C_DELETED , 0}, {"renamed" , C_RENAMED, 0}, {"conflict" , C_CONFLICT , 0}, {"meta" , C_META , 0}, {"unmodified" , C_UNMODIFIED, 0}, {"all" , C_ALL , 0}, {"extra" , C_EXTRA , 0}, {"merge" , C_MERGE , 0}, {"sha1sum" , C_SHA1SUM , 0}, {"header" , C_HEADER , 1}, {"v" , C_VERBOSE , 1}, {"verbose" , C_VERBOSE, 1}, {"classify" , C_CLASSIFY , 1}, }, noFlagDefs[] = { {"no-merge", C_MERGE , 0}, {"no-classify", C_CLASSIFY , 1}, }; #ifdef FOSSIL_DEBUG static const char *const bits[] = { "EDITED", "UPDATED", "CHANGED", "MISSING", "ADDED", "DELETED", "RENAMED", "CONFLICT", "META", "UNMODIFIED", "EXTRA", "MERGE", "RELPATH", "SHA1SUM", "HEADER", "VERBOSE", "CLASSIFY", }; #endif int changes = g.argv[1][0]=='c'; unsigned flags = 0; int vid, i; /* Load affirmative flag options. */ for( i=0; i<count(flagDefs); ++i ){ if( (!flagDefs[i].changesOnly || changes) && find_option(flagDefs[i].option, 0, 0) ){ flags |= flagDefs[i].mask; } } /* If no filter options are specified, enable defaults. */ if( !(flags & C_FILTER) ){ flags |= C_DEFAULT; } /* If more than one filter is enabled, enable classification. This is tricky. * Having one filter means flags masked by C_FILTER is a power of two. If a * number masked by one less than itself is zero, it's either zero or a power * of two. It's already known to not be zero because of the above defaults. * Unlike --all, --changed is a single filter, i.e. it sets only one bit. * Also force classification for the status command. */ if( !changes || (flags & (flags-1) & C_FILTER) ){ flags |= C_CLASSIFY; } /* Negative flag options override defaults applied above. */ for( i=0; i<count(noFlagDefs); ++i ){ if( (!noFlagDefs[i].changesOnly || changes) && find_option(noFlagDefs[i].option, 0, 0) ){ flags &= ~noFlagDefs[i].mask; } } /* Confirm current working directory is within checkout. */ db_must_be_within_tree(); /* Relative path flag determination is done by a shared function. */ if( determine_cwd_relative_option() ){ flags |= C_RELPATH; } #ifdef FOSSIL_DEBUG for( i=0; i<count(bits); ++i ){ if( flags & (1 << i) ){ printf("%s ", bits[i]); } } printf("\n"); #endif /* We should be done with options. */ verify_all_options(); /* The status command prints general information before the change list. */ if( !changes ){ vid = db_lget_int("checkout", 0); fossil_print("repository: %s\n", db_repository_filename()); fossil_print("local-root: %s\n", g.zLocalRoot); if( g.zConfigDbName ){ fossil_print("config-db: %s\n", g.zConfigDbName); } if( vid ){ show_common_info(vid, "checkout:", 1, 1); } db_record_repository_filename(0); } /* Print all requested changes. */ print_changes(flags); /* The status command ends with warnings about ambiguous leaves (forks). */ if( !changes ){ leaf_ambiguity_warning(vid, vid); } } /* ** Take care of -r version of ls command */ static void ls_cmd_rev( const char *zRev, /* Revision string given */ |
︙ | ︙ |