/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to doc/developers/commit.txt

  • Committer: John Ferlito
  • Date: 2009-09-02 04:31:45 UTC
  • mto: (4665.7.1 serve-init)
  • mto: This revision was merged to the branch mainline in revision 4913.
  • Revision ID: johnf@inodes.org-20090902043145-gxdsfw03ilcwbyn5
Add a debian init script for bzr --serve

Show diffs side-by-side

added added

removed removed

Lines of Context:
101
101
 
102
102
3 - Before starting the commit proper, we prompt for a commit message
103
103
and in that commit message editor we show a list of the files that
104
 
will be committed: basically the output of brz status.  This is
 
104
will be committed: basically the output of bzr status.  This is
105
105
basically the same as the list of changes we detect while storing the
106
106
commit, but because the user will sometimes change the tree after
107
107
opening the commit editor and expect the final state to be committed I
130
130
they don't seem to have substantial performance consequences.
131
131
 
132
132
If one wanted to optimize solely for the speed of commit I think
133
 
hash-addressed  file-per-text storage like in git (or Breezy 0.1) is very
 
133
hash-addressed  file-per-text storage like in git (or bzr 0.1) is very
134
134
good.  Remarkably, it does not need to read the inventory for the
135
135
previous revision.  For each versioned file, we just need to get its
136
136
hash, either by reading the file or validating its stat data.  If that
174
174
     happened several commits back. There are several edge cases to be
175
175
     handled here, like if both branches modified the same file, or if
176
176
     just one branch modified it.
177
 
 
 
177
     
178
178
  b) The trickier case is when a file appears unmodified since last
179
179
     commit, but it was modified versus one of the merged branches. I
180
180
     believe there are a few ways this can happen, like if a merged
186
186
     the 2 parents).
187
187
 
188
188
3) **Automatic deletion of 'missing' files.** This is a point that we go
189
 
   back and forth on. I think the basic idea is that 'brz commit' by
 
189
   back and forth on. I think the basic idea is that 'bzr commit' by
190
190
   default should abort if it finds a 'missing' file (in case that file was
191
 
   renamed rather than deleted), but 'brz commit --auto' can add unknown
 
191
   renamed rather than deleted), but 'bzr commit --auto' can add unknown
192
192
   files and remove missing files automatically.
193
193
 
194
194
4) **sha1 for newly added files.** status doesn't really need this: it should
262
262
all the work to do really fast comparison and throw-away of unimportant
263
263
records.
264
264
 
265
 
The way I made "brz status" fast is by moving the 'ignore this record'
 
265
The way I made "bzr status" fast is by moving the 'ignore this record'
266
266
ability as deep into the stack as I could get. Status has the property
267
267
that you don't care about most of the records, just like commit. So the
268
268
sooner you can stop evaluating the 99% that you don't care about, the
291
291
It is desirable to avoid roundtrips to the Repository during commit,
292
292
particularly because it may be remote.  If the WorkingTree can determine
293
293
by itself that a text was in the parent and therefore should be in the
294
 
Repository that avoids one roundtrip per file.
 
294
Repository that avoids one roundtrip per file.  
295
295
 
296
296
There is a possibility here that the parent revision is not stored, or not
297
297
correctly stored, in the repository the tree is being committed into, and
311
311
This creates a CommitBuilder object matched to the Branch, Repository and
312
312
Tree.  It can vary depending on model differences or by knowledge of what
313
313
is efficient with the Repository and Tree.  Model differences might
314
 
include whether no-text-change merges need to be reported, and whether the
 
314
include whether no-text-change merges need to be reported, and whether the 
315
315
 
316
 
The basic CommitBuilder.commit structure can be
 
316
The basic CommitBuilder.commit structure can be 
317
317
 
318
318
1. Ask the branch if it is ready to commit (up to date with master if
319
319
   any.)
358
358
 
359
359
* the working tree basis is up to date with the branch tip
360
360
 
361
 
* the local branch is up to date with the master branch, if there
 
361
* the local branch is up to date with the master branch, if there 
362
362
  is one and --local is not specified
363
363
 
364
 
* an empty commit message is given,
 
364
* an empty commit message is given, 
365
365
 
366
366
* a hook flags an error
367
367
 
396
396
* if there are tree references and recursing into them is enabled, then
397
397
  do so
398
398
 
399
 
Commit needs to protect against duplicated file ids
 
399
Commit needs to protect against duplicated file ids 
400
400
 
401
401
 
402
402
Updates that need to be made in the working tree, either on conclusion
429
429
* or an indication that it should be read interactively from the ui object;
430
430
* a list of files to commit
431
431
* an option for a dry-run commit
432
 
* verbose option, or callback to indicate
 
432
* verbose option, or callback to indicate 
433
433
* timestamp, timezone, committer, chosen revision id
434
434
* config (for what?)
435
435
* option for local-only commit on a bound branch
436
436
* option for strict commits (fail if there are unknown or missing files)
437
437
* option to allow "pointless" commits (with no tree changes)
438
 
 
 
438
 
439
439
(This is rather a lot of options to pass individually and just for code tidyness maybe some of them should be combine into objects.)
440
440
 
441
441
>>> Branch.commit(from_tree, message, files_to_commit, ...)
466
466
This needs to collect a list of added/changed/removed files, each of which
467
467
must have its text stored (if any) and containing directory updated.  This
468
468
can be done by calling Tree._iter_changes on the source tree, asking for
469
 
changes
 
469
changes 
470
470
 
471
471
In the 0.17 model the commit operation needs to know the per-file parents
472
 
and per-file last-changed revision.
 
472
and per-file last-changed revision.  
473
473
 
474
474
(In this and other operations we must avoid having multiple layers walk
475
475
over the tree separately.  For example, it is no good to have the Command
530
530
The main things the tree needs to tell the Branch about are:
531
531
 
532
532
* A file is modified from its parent revision (in text, permissions,
533
 
  other), and so its text may need to be stored.
534
 
 
 
533
  other), and so its text may need to be stored.  
 
534
  
535
535
  Files should also be reported if they have more than one unique parent
536
536
  revision, for repositories that store per-file graphs or last-change
537
537
  revisions.  Perhaps this behaviour should be optional.
540
540
 
541
541
* The complete contents of a modified directory, so that its inventory
542
542
  text may be stored.  This should be done after all the contained files
543
 
  and directories have been reported.  If there are unmodified files,
544
 
  or unselected files carried through from
 
543
  and directories have been reported.  If there are unmodified files, 
 
544
  or unselected files carried through from 
545
545
 
546
 
  XXX: Actually perhaps not grouped by directory, but rather grouped
547
 
  appropriately for the shape of inventory storage in the repository.
 
546
  XXX: Actually perhaps not grouped by directory, but rather grouped 
 
547
  appropriately for the shape of inventory storage in the repository. 
548
548
 
549
549
  In a zoomed-in checkout the workingtree may not have all the shape data
550
550
  for the entire tree.
577
577
This might be construed as an enhanced version of ``set_parent_trees``.
578
578
We can avoid a stat on each file by using the value that was observed when
579
579
it was first read.
580
 
 
 
580
 
581
581
 
582
582
 
583
583
Selective commit
591
591
However, the tree walking code does probably need to know about selected
592
592
paths to avoid examining unselected files or directories.
593
593
 
594
 
We never refuse selective file commits (except of merges).
 
594
We never refuse selective file commits (except of merges).  
595
595
 
596
596
 
597
597