Edgewall Software

Changes between Version 15 and Version 16 of VcRefactoring


Ignore:
Timestamp:
Jan 28, 2012, 12:35:12 PM (12 years ago)
Author:
Christian Boos
Comment:

start to update the page, remove now obsolete information about done tasks and gather constraints for futur developments

Legend:

Unmodified
Added
Removed
Modified
  • VcRefactoring

    v15 v16  
    11= Version Control Refactoring =
    22
    3 This recurring branch is a sandbox for introducing new features
    4 that are potentially disruptive.
    5 
    6 Note that there's currently no source:sandbox/vc-refactoring branch, but
    7 there's a source:sandbox/multirepos one for the [#SupportforMultipleRepositories].
     3This recurring topic is the place to discuss the design of new features
     4for the **version control** subsystem of Trac.
    85
    96[[PageOutline]]
    107
    11 The major goals for [milestone:0.12] in the versioncontrol area will be:
    12  1. support for multiple repositories
     8Some of the major goals are:
     9 1. ~~support for multiple repositories~~
    1310 2. support for scm neutral cache
    1411 3. ideally, if the GenericTrac approach is finalized, arbitrary properties,
     
    1815The forthcoming changes aim to better support some
    1916advanced version control system backends, like
    20 [http://www.selenic.com/mercurial Mercurial].
     17[http://www.selenic.com/mercurial Mercurial] and [http://git-scm.org git],
     18while not (completely) forgetting [http://subversion.apache.org Subversion] (yet).
    2119To that effect, the changes added to the core will be
    22 exercised by jointly developing the TracMercurial plugin.
     20exercised by jointly developing the TracMercurial plugin
     21and probably the GitPlugin as well (see in [source:plugins]).
    2322
    2423Sub topics:
    2524[[TitleIndex(VcRefactoring/)]]
     25 - Initial Mercurial support - [./@15#SupportforMercurial-likeVersionControlSystem]
     26 - MultiRepos - see source:sandbox/multirepos and [./@15#SupportforMultipleRepositories]
    2627
    27 The current controller changes are simple refactorings which are not changing the versioncontrol API, but cleaning up the internals of the versioncontrol related web ui.
    28 Those changes could eventually go in 0.11.
    29 
    30 
    31 == Support for Multiple scopes within a Repository ==
    32 
    33 This is mostly done in trunk, now.
    34  * This basically means fixing #1830. Initial work on this was done in r2992.
    35    This has been reworked more in-depth in [3174/trunk/trac/versioncontrol/svn_fs.py].
    36  * There's also the idea to "scope" a repository using multiple paths.
    37    This will probably be done for milestone:0.11.
    38    Actually, it should be possible to achieve the above using FineGrainedPermissions,
    39    thanks to r3174, but I haven't verified this, up to now.
    40 
    41 
    42 == Support for Multiple Repositories ==
    43 
    44 A first implementation of this feature is now available in the MultipleRepositorySupport branch (for the next release, i.e. Trac [milestone:0.12]).
    45 
    46 The problematic of the cache is for now avoided, this multiple repository support is only for the non-cached repositories, i.e. `hg` (Mercurial) and `direct-svnfs` (Subversion). You can happily mix ''both'' types of repositories, if needed.
    47 
    48 The cache needs to be modified/extended as well,
    49 in order to accommodate multiple repositories.
    50 
    51 There are several options:
    52  1. use the cache as it is, merging all the repositories in a kind of virtual repository;
    53     the first component of the path would be the name of the repository.
    54  2. use a separate pair of tables for each repository
    55  3. use a dedicated db to cache each repository
    56 
    57 Option 1. seems the best way to go.
    58 Its efficiency depends mainly about how the new cache will be implemented.
    59 If we go with path ids, then using one table would be practical, I think.
    60 
    61 See also: #2086, trac-dev:340 and, more recently, [googlegroups:trac-users:14ca95377e4a53b5 this mail] where I explain how TracLinks will support multiple repositories.
    62 
    63 Another important interdependency which comes to mind is the support for multiple projects in a single environment (see this
    64 [TracMultipleProjects/SingleEnvironment#ProposedImplementation proposal]).
    65 
    66 In this scenario, each project would have one or more repositories.
    67 Those repositories could eventually be ''shared'' between projects.
    68 
    69 Take the following example:
    70  - Project A
    71    - repository /srv/svn/repo1 (trunk, branches, etc.)
    72  - Project B
    73    - repository /srv/svn/repo1 (trunk, branches, etc.)
    74    - repository /srv/svn/repo2 (trunk, branches, etc.)
    75 
    76 Within a wiki page of project A, `[123]` or `source:trunk/` would have the usual 1-to-1 meaning. The same resources, referenced from within a page belonging to project B could be accessed using InterTrac links: `[A123]` or `A:source:trunk/`.
    77 
    78 Now within project B, referring to `[123]` or `source:trunk/` would be ambiguous,
    79 unless a ''default'' repository would be specified (say /srv/svn/repo2).
    80 But in general, ''path restriction'' should be used to properly identify the resource:
    81 `[123/repo1]`, `source:repo1/trunk/` and `[123/repo2]`, `source:repo2/trunk/`.
    82 
    83 ''How about `[123@repo2]`, `source:@repo2/trunk` and let `[source:trunk]` go to the default repository of the project so that when a new repository is added to the project, all existing links won't break?''[[br]]''-- Kenneth Xu''
    84 
    85 The ''only'' problem with this approach would be to risk some confusion if a repository name is also used as a toplevel folder name of some other repository in the same project. I'm don't think it's a showstopper though, as:
    86  - this shouldn't happen often in the first place
    87  - if it happens nevertheless, a simple disambiguation rule could be adopted,
    88    like always consider that if the first element in the path restriction
    89    corresponds to a repository name when multiple repositories are present,
    90    then it's used as a repository selector.
    91 
    92 On the data model level, the cache for /srv/svn/repo1 will be shared for projects A and B. We simply need an additional relation table, pairing projects with repositories.
    93 
    94 == Support for Mercurial-like Version Control System ==
    95 
    96 ===  Basic Level ===
    97  * DONE:
    98    * support for non-numerical changesets (start with hexadecimal digit support)
    99    * support for extra changeset properties
    100      * basic infrastructure in trunk
    101      * support for SVN: see #2545
    102 
    103 Those are the minimal changes needed so that the TracMercurial plugin can work at all.
    104 
    105 
    106 === Advanced Level ===
    107 
    108  * TracRevisionLog should show the branches (a la
    109    [http://www.flickr.com/photos/search/tags:mercurial%2Chgk/tagmode:all/ hgk]).
    110    See also #1492.
    111  * DONE:
    112    * Support for arbitrary changeset names (e.g. `[tip]` or `[head]`)
    113    * Support for direct jump to a tag or a branch.
    114      Done on the branch (r3017); re-done for 0.11 (now in trunk)
    115 
    116 === Support for Big Repositories ===
    117 
    118 This means extending cache support.
    119 Support for multiple repositories would also require some changes to
    120 the caching anyway.
    121 
    122 This is material for Trac [milestone:0.12]...
    12328
    12429== New Repository Cache ==
    12530
    126 I think I've come up with a new caching scheme that would
    127 be able to handle this. The idea is to replicate the tree
    128 changes information that svn stores. This should also work
    129 for Mercurial or other backends.
     31A new cache should be designed with the primary focus on achieving maximal performance for the tasks needed by the TracBrowser. The current cache simply contains the required information, but not organized in a way that can speed-up by indexes for the common tasks.
    13032
    131 The `node_changes` table could even be kept as it is, I think.
    132 The main difference would be that we should also add the paths
    133 for files and folders that were not modified themselves, but
    134 happen to be in the same folder as one of the file or folder
    135 that has been modified.
     33The primary example for this is the prev_next_rev queries. The second example would be the get_entries() call which is expensive for TracMercurial and TracGit.
    13634
    137 That way, we could implement:
     35The other constraints would be:
    13836 - `Repository.get_node(path, rev)` using the cached information only,
    13937   which would be a dramatic improvement for Mercurial, which has no
    14038   information about the folder themselves.
    141  - Likewise, `Repository.get_path_history` could also be implemented
     39 - `Repository.get_path_history` could also be implemented
    14240   in a generic and efficient way using that caching scheme.
     41   This would also help address #10183 and #7744.
    14342 - The next/prev history navigation between revisions (or rather,
    14443   their extended children/parents versions) could also be implemented
    145    on top of the cache.
     44   on top of the cache (#8639; #7254; ticket:8813#comment:10)
    14645 - Probably `Node.get_history` as well, not to mention the possibility
    14746   to find out the ''copy_to'' information (#1445).
     
    15049   (that would solve the #2353 issue).
    15150
     51
     52=== `node_change` + directories
     53
     54One idea would be to keep the `node_change` table as it is
     55but we should also add the paths for files and folders that
     56were not modified themselves, but happen to be in the same
     57folder as one of the file or folder that has been modified.
    15258
    15359Example:
     
    16369
    16470Would result in:
    165 || '''rev''' || '''path''' || '''node_type''' || '''change_type''' || '''base_path''' || '''base_rev''' ||
     71||= rev ||= path ||= node_type ||= change_type ||= base_path ||= base_rev ||
    16672|| 1 || trunk || D || A || || -1 ||
    16773|| 1 || trunk/dir1 || D || A || || -1 ||
     
    204110and only the filename part would be in clear text (#3676?).
    205111
    206 
    207 Mercurial would need to store additional information per node,
    208 in particular the file size. Using Mercurial:RevlogNG, that
    209 information would be cheap to get, but revlogng is not yet
    210 widely used. -- ''update: source:plugins/0.11/mercurial-plugin uses the new API''
    211 
    212112The most flexible approach for storing extra node fields is certainly
    213113to let each backend create and maintain an additional table,
    214114e.g. `node_changes_hg` (see also #2733).
    215 
    216115
    217116In addition, there will most certainly be the need for a kind of