Edgewall Software
Modify

Opened 19 years ago

Last modified 10 years ago

#3236 new enhancement

Support for a merge change type in version control API

Reported by: lewisbaker@… Owned by:
Priority: normal Milestone: next-major-releases
Component: version control Version: devel
Severity: normal Keywords: merge
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Trac currently supports add, edit, delete, copy and move change types for files in a changeset. However, it would also be nice if Trac supported some of the merge change type for changes that involve merging changes from other files.

I realise that Subversion doesn't currently implement merge tracking natively (yet), but I have been working on a Perforce plugin for Trac (similar to the one described in #257 but based on PyPerforce) and would like to be able to get Perforce's merge/integration information displayed through Trac.

Perforce supports a number of different merge/integration types:

  • branch from - An exact copy of a file to a new location. Equivalent to Trac's copy or move depending on whether the source file was also deleted in the same changeset.
  • add from - A copy of a file to a new location that has been modified before checkin (related to #3172).
  • copy from - A merge operation that ignores any changes in the target file, effectively replacing the target with the source.
  • ignore from - A merge operation that ignores any changes in the source file, keeping the target file's changes.
  • merge from - A merge operation that merges the changes from both source and target files.
  • edit from - A merge operation that merges the changes from both source and target files and contains original user edits.
  • delete from - A merge of a deleted source file into the target file, deleting the target file. Basically a delete operation with an associated source file.

See the p4 integrated documentation for more info on the Perforce integration model.

Attachments (0)

Change History (9)

comment:1 by lewisbaker@…, 19 years ago

This could be implemented by adding a new merge type to the Changeset class at source:trunk/trac/versioncontrol/api.py@3294#L306 and modifying the Changeset.get_changes() method to yield (path, kind, change, integrations) tuples where integrations is a list of (base_path, base_rev, merge_type) tuples and merge_type is one of copy, ignore, merge, edit or delete.

comment:2 by Christian Boos, 19 years ago

Milestone: 0.11
Owner: changed from Christopher Lenz to Christian Boos

While the Changeset.MERGE type is probably a good idea, the rest seems too specific to Perforce to be worth adding in the generic interface as such.

Probably a better way would be a possibility to extend the file information (that would be also interesting for systems supporting file specific comment).

Btw, perhaps you could already do that by using the properties API, and generate a special integrated property?

comment:3 by lewisbaker@…, 18 years ago

I think that in order to support a Changeset.MERGE type you need to be able to specify a list of node revision ranges that were merged as part of the change. Whether this is part of the Changeset.get_changes() or Node.get_history() APIs or as a Changeset or Node property is an implementation detail, I guess.

However, it would be best if there was a well-known place to retrieve this info so that the web_ui module is able to display this information in similar way to the copied from <path> information in the changeset and log views.

comment:4 by Christian Boos, 18 years ago

Milestone: 0.110.12

Not for 0.11, but a hot topic for 0.12 and the many vc improvements that will happen there ;-)

comment:5 by Christian Boos, 15 years ago

Keywords: merge added
Milestone: next-major-0.1X0.13

Goes together with #1492.

comment:6 by Christian Boos, 14 years ago

Milestone: 0.13next-major-0.1X
Resolution: worksforme
Status: newclosed

comment:7 by Remy Blank, 14 years ago

Resolution: worksforme
Status: closedreopened

I assume closing wasn't intentional?

comment:8 by Christian Boos, 14 years ago

Right, this ticket should be used for extending the changeset rendering to display 3-way diffs.

comment:9 by Ryan J Ollos, 10 years ago

Owner: Christian Boos removed
Status: reopenednew

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.