~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to TODO

  • Committer: Martin Pool
  • Date: 2005-06-20 03:29:21 UTC
  • Revision ID: mbp@sourcefrog.net-20050620032921-240d0ade23545055
- remove redundant precursor check

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.. -*- mode: indented-text; compile-command: "make -C doc" -*- 
 
2
 
 
3
 
 
4
*******************
 
5
Things to do in bzr
 
6
*******************
 
7
 
 
8
 
 
9
See also various low-level TODOs in the source code.  Try looking in
 
10
the list archive or on gmane.org for previous discussion of these
 
11
issues.
 
12
 
 
13
These are classified by approximate size: an hour or less, a day or
 
14
less, and several days or more.
 
15
 
 
16
 
 
17
Small things
 
18
------------
 
19
 
 
20
* Add of a file that was present in the base revision should put back
 
21
  the previous file-id.
 
22
 
 
23
* Handle diff of files which do not have a trailing newline; probably
 
24
  requires patching difflib to get it exactly right, or otherwise
 
25
  calling out to GNU diff.
 
26
 
 
27
* Import ElementTree update patch.
 
28
 
 
29
* Plugins that provide commands.  By just installing a file into some
 
30
  directory (e.g. ``/usr/share/bzr/plugins``) it should be possible to
 
31
  create new top-level commands (``bzr frob``).  Extensions can be
 
32
  written in either Python (in which case they use the bzrlib API) or
 
33
  in a separate process (in sh, C, whatever).   It should be possible
 
34
  to get help for plugin commands.
 
35
 
 
36
* Smart rewrap text in help messages to fit in $COLUMNS (or equivalent
 
37
  on Windows)
 
38
 
 
39
* -r option should take a revision-id as well as a revno.
 
40
 
 
41
* ``bzr info`` could show space used by working tree, versioned files,
 
42
  unknown and ignored files. 
 
43
 
 
44
* ``bzr info`` should count only people with distinct email addresses as
 
45
  different committers.  (Or perhaps only distinct userids?)
 
46
 
 
47
* On Windows, command-line arguments should be `glob-expanded`__,
 
48
  because the shell doesn't do this.  However, there are probably some
 
49
  commands where this shouldn't be done, such as 'bzr ignore', because
 
50
  we want to accept globs.
 
51
 
 
52
* ``bzr ignore`` command that just adds a line to the ``.bzrignore`` file
 
53
  and makes it versioned.  Fix this to break symlinks.
 
54
 
 
55
* Any useful sanity checks in 'bzr ignore'?  Perhaps give a warning if
 
56
  they try to add a single file which is already versioned, or if they
 
57
  add a pattern which already exists, or if it looks like they gave an
 
58
  unquoted glob.
 
59
 
 
60
__ http://mail.python.org/pipermail/python-list/2001-April/037847.html
 
61
 
 
62
* Separate read and write version checks?
 
63
 
 
64
* ``bzr status DIR`` should give status on all files under that
 
65
  directory.
 
66
 
 
67
* ``bzr log DIR`` should give changes to any files within DIR.
 
68
 
 
69
* Check all commands have decent help.
 
70
 
 
71
* ``bzr inventory -r REV`` and perhaps unify this with ``bzr ls``,
 
72
  giving options to display ids, types, etc.
 
73
 
 
74
* Split BzrError into various more specific subclasses for different
 
75
  errors people might want to catch.
 
76
 
 
77
* If the export destination ends in '.tar', '.tar.gz', etc then create
 
78
  a tarball instead of a directory.  (Need to actually make a
 
79
  temporary directory and then tar that up.)
 
80
 
 
81
  http://www.gelato.unsw.edu.au/archives/git/0504/2194.html
 
82
  
 
83
* RemoteBranch could maintain a cache either in memory or on disk.  We
 
84
  know more than an external cache might about which files are
 
85
  immutable and which can vary.  On the other hand, it's much simpler
 
86
  to just use an external proxy cache.
 
87
 
 
88
  Perhaps ~/.bzr/http-cache.  Baz has a fairly simple cache under
 
89
  ~/.arch-cache, containing revision information encoded almost as a
 
90
  bunch of archives.  Perhaps we could simply store full paths.
 
91
 
 
92
* Maybe also store directories in the statcache so that we can quickly
 
93
  identify that they still exist.
 
94
 
 
95
* Diff should show timestamps; for files from the working directory we
 
96
  can use the file itself; for files from a revision we should use the
 
97
  commit time of the revision.
 
98
 
 
99
* Perhaps split command infrastructure from the actual command
 
100
  definitions.
 
101
 
 
102
* Cleaner support for negative boolean options like --no-recurse.
 
103
 
 
104
* Statcache should possibly map all file paths to / separators
 
105
 
 
106
* quotefn doubles all backslashes on Windows; this is probably not the
 
107
  best thing to do.  What would be a better way to safely represent
 
108
  filenames?  Perhaps we could doublequote things containing spaces,
 
109
  on the principle that filenames containing quotes are unlikely?
 
110
  Nice for humans; less good for machine parsing.
 
111
 
 
112
* Patches should probably use only forward slashes, even on Windows,
 
113
  otherwise Unix patch can't apply them. (?) 
 
114
 
 
115
* Branch.update_revisions() inefficiently fetches revisions from the
 
116
  remote server twice; once to find out what text and inventory they
 
117
  need and then again to actually get the thing.  This is a bit
 
118
  inefficient. 
 
119
 
 
120
  One complicating factor here is that we don't really want to have
 
121
  revisions present in the revision-store until all their constituent
 
122
  parts are also stored.
 
123
 
 
124
  The basic problem is that RemoteBranch.get_revision() and similar
 
125
  methods return object, but what we really want is the raw XML, which
 
126
  can be popped into our own store.  That needs to be refactored.
 
127
 
 
128
* ``bzr status FOO`` where foo is ignored should say so.
 
129
  
 
130
 
 
131
 
 
132
Medium things
 
133
-------------
 
134
 
 
135
* Merge revert patch.
 
136
 
 
137
* ``bzr mv`` that does either rename or move as in Unix.
 
138
 
 
139
* More efficient diff of only selected files.  We should be able to
 
140
  just get the id for the selected files, look up their location and
 
141
  diff just those files.  No need to traverse the entire inventories.
 
142
 
 
143
* ``bzr status DIR`` or ``bzr diff DIR`` should report on all changes
 
144
  under that directory.
 
145
 
 
146
* Fix up Inventory objects to represent root object as an entry.
 
147
 
 
148
* Don't convert entire entry from ElementTree to an object when it is
 
149
  read in, but rather wait until the program actually wants to know
 
150
  about that node.
 
151
 
 
152
* Extract changes from one revision to the next to a text form
 
153
  suitable for transmission over email.
 
154
 
 
155
* More test cases.
 
156
 
 
157
  - Selected-file commit
 
158
 
 
159
  - Impossible selected-file commit: adding things in non-versioned
 
160
    directories, crossing renames, etc.
 
161
 
 
162
* Write a reproducible benchmark, perhaps importing various kernel versions.
 
163
 
 
164
* Directly import diffs!  It seems a bit redundant to need to rescan
 
165
  the directory to work out what files diff added/deleted/changed when
 
166
  all the information is there in the diff in the first place.
 
167
  Getting the exact behaviour for added/deleted subdirectories etc
 
168
  might be hard.
 
169
 
 
170
  At the very least we could run diffstat over the diff, or perhaps
 
171
  read the status output from patch.  Just knowing which files might
 
172
  be modified would be enough to guide the add and commit.
 
173
  
 
174
  Given this we might be able to import patches at 1/second or better.
 
175
 
 
176
* Get branch over http.
 
177
 
 
178
* Pull pure updates over http.
 
179
 
 
180
* revfile compression.
 
181
 
 
182
* Split inventory into per-directory files.
 
183
 
 
184
* Fix ignore file parsing:
 
185
 
 
186
  - fnmatch is not the same as unix patterns
 
187
 
 
188
  - perhaps add extended globs from rsh/rsync
 
189
 
 
190
  - perhaps a pattern that matches only directories or non-directories
 
191
 
 
192
* Consider using Python logging library as well as/instead of
 
193
  bzrlib.trace.
 
194
 
 
195
* Commands should give some progress indication by default.
 
196
 
 
197
  - But quieten this with ``--silent``.
 
198
 
 
199
* Change to using gettext message localization.
 
200
 
 
201
* Make a clearer separation between internal and external bzrlib
 
202
  interfaces.  Make internal interfaces use protected names.  Write at
 
203
  least some documentation for those APIs, probably as docstrings.
 
204
 
 
205
  Consider using ZopeInterface definitions for the external interface;
 
206
  I think these are already used in PyBaz.  They allow automatic
 
207
  checking of the interface but may be unfamiliar to general Python
 
208
  developers, so I'm not really keen.
 
209
 
 
210
* Commands to dump out all command help into a manpage or HTML file or
 
211
  whatever.
 
212
 
 
213
* Handle symlinks in the working directory; at the very least it
 
214
  should be possible for them to be present and ignored/unknown
 
215
  without causing assertion failures. 
 
216
 
 
217
  Eventually symlinks should be versioned.
 
218
 
 
219
* Allow init in a subdirectory to create a nested repository, but only
 
220
  if the subdirectory is not already versioned.   Perhaps also require
 
221
  a ``--nested`` to protect against confusion.
 
222
 
 
223
* Branch names? 
 
224
 
 
225
* More test framework:
 
226
 
 
227
  - Class that describes the state of a working tree so we can just
 
228
    assert it's equal.
 
229
 
 
230
* There are too many methods on Branch() that really manipulate the
 
231
  WorkingTree.  They should be moved across.  
 
232
 
 
233
  Also there are some methods which are duplicated on Tree and
 
234
  Inventory objects, and it should be made more clear which ones are
 
235
  proxies and which ones behave differently, and how.
 
236
 
 
237
* Try using XSLT to add some formatting to REST-generated HTML.  Or
 
238
  maybe write a small Python program that specifies a header and foot
 
239
  for the pages and calls into the docutils libraries.
 
240
 
 
241
* --format=xml for log, status and other commands.
 
242
 
 
243
* Attempting to explicitly add a file that's already added should give
 
244
  a warning; however there should be no warning for directories (since
 
245
  we scan for new children) or files encountered in a directory that's
 
246
  being scanned.
 
247
 
 
248
* Better handling of possible collisions on case-losing filesystems;
 
249
  make sure a single file does not get added twice under different
 
250
  names.
 
251
 
 
252
* Clean up XML inventory:
 
253
 
 
254
  - Use nesting rather than parent_id pointers.
 
255
 
 
256
  - Hold the ElementTree in memory in the Inventory object and work
 
257
    directly on that, rather than converting into Python objects every
 
258
    time it is read in.  Probably still exposoe it through some kind of
 
259
    object interface though, but perhaps that should just be a proxy
 
260
    for the elements.
 
261
 
 
262
  - Less special cases for the root directory. 
 
263
 
 
264
* Perhaps inventories should remember the revision in which each file
 
265
  was last changed, as well as its current state?  This is a bit
 
266
  redundant but might often be interested to know.
 
267
 
 
268
* stat cache should perhaps only stat files as necessary, rather than
 
269
  doing them all up-front.  On the other hand, that disallows the
 
270
  opimization of stating them in inode order.
 
271
 
 
272
* It'd be nice to pipeline multiple HTTP requests.  Often we can
 
273
  predict what will be wanted in future: all revisions, or all texts
 
274
  in a particular revision, etc.  
 
275
 
 
276
  urlgrabber's docs say they are working on batched downloads; we
 
277
  could perhaps ride on that or just create a background thread (ew).
 
278
 
 
279
* Paranoid mode where we never trust SHA-1 matches.
 
280
 
 
281
* Don't commit if there are no changes unless forced.
 
282
 
 
283
* --dry-run mode for commit?  (Or maybe just run with
 
284
  check-command=false?)
 
285
 
 
286
* Generally, be a bit more verbose unless --silent is specified.
 
287
 
 
288
* Function that finds all changes to files under a given directory;
 
289
  perhaps log should use this if a directory is given.
 
290
 
 
291
* XML attributes might have trouble with filenames containing \n and
 
292
  \r.  Do we really want to support this?  I think perhaps not.
 
293
 
 
294
* Remember execute bits, so that exports will work OK.
 
295
 
 
296
* Unify smart_add and plain Branch.add(); perhaps smart_add should
 
297
  just build a list of files to add and pass that to the regular add
 
298
  function.
 
299
 
 
300
* Function to list a directory, saying in which revision each file was
 
301
  last modified.  Useful for web and gui interfaces, and slow to
 
302
  compute one file at a time.
 
303
 
 
304
* unittest is standard, but the results are kind of ugly; would be
 
305
  nice to make it cleaner.
 
306
 
 
307
* Check locking is correct during merge-related operations.
 
308
 
 
309
* Perhaps attempts to get locks should timeout after some period of
 
310
  time, or at least display a progress message.
 
311
 
 
312
* Split out upgrade functionality from check command into a separate
 
313
  ``bzr upgrade``.
 
314
 
 
315
 
 
316
Large things
 
317
------------
 
318
 
 
319
* Generate annotations from current file relative to previous
 
320
  annotations.
 
321
 
 
322
  - Is it necessary to store any kind of annotation where data was
 
323
    deleted?
 
324
 
 
325
* Update revfile_ format and make it active:
 
326
 
 
327
  - Texts should be identified by something keyed on the revision, not
 
328
    an individual text-id.  This is much more useful for annotate I
 
329
    think; we want to map back to the revision that last changed it.
 
330
 
 
331
  - Access revfile revisions through the Tree/Store classes.
 
332
 
 
333
  - Check them from check commands.
 
334
 
 
335
  - Store annotations.
 
336
 
 
337
.. _revfile: revfile.html
 
338
 
 
339
* Hooks for pre-commit, post-commit, etc.
 
340
 
 
341
  Consider the security implications; probably should not enable hooks
 
342
  for remotely-fetched branches by default.
 
343
 
 
344
* Pre-commit check.  If this hook is defined, it needs to be handled
 
345
  specially: create a temporary directory containing the tree as it
 
346
  will be after the commit.  This means excluding any ignored/unknown
 
347
  files, and respecting selective commits.  Run the pre-commit check
 
348
  (e.g. compile and run test suite) in there.
 
349
 
 
350
  Possibly this should be done by splitting the commit function into
 
351
  several parts (under a single interface).  It is already rather
 
352
  large.  Decomposition:
 
353
 
 
354
   - find tree modifications and prepare in-memory inventory
 
355
 
 
356
   - export that inventory to a temporary directory
 
357
 
 
358
   - run the test in that temporary directory
 
359
 
 
360
   - if that succeeded, continue to actually finish the commit
 
361
 
 
362
  What should be done with the text of modified files while this is
 
363
  underway?  I don't think we want to count on holding them in memory
 
364
  and we can't trust the working files to stay in one place so I
 
365
  suppose we need to move them into the text store, or otherwise into
 
366
  a temporary directory.
 
367
 
 
368
  If the commit does not actually complete, we would rather the
 
369
  content was not left behind in the stores.  
 
370
 
 
371
* Web interface
 
372
 
 
373
* GUI (maybe in Python GTK+?)
 
374
 
 
375
* C library interface
 
376
 
 
377
* Expansion of $Id$ keywords within working files.  Perhaps do this in
 
378
  exports first as a simpler case because then we don't need to deal
 
379
  with removing the tags on the way back in.
 
380
 
 
381
* ``bzr find``