unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* transplant revisions between unrelated projects
@ 2012-04-17 16:13 Lluís
  2012-04-18 21:42 ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Lluís @ 2012-04-17 16:13 UTC (permalink / raw)
  To: emacs-devel, cedet-devel, bazaar

First of all, sorry for the cross-posting, but I though this might be of
interest to people on all these lists.

I've pulled together a small bazaar plugin to transplant revisions between
totally unrelated projects, with the support to select which are these file,
together with regular expressions to rename them on the way.

You can find the code here:

    https://launchpad.net/bzr-tp/trunk

This will give some more details on how to use it:

    bzr help transplant

Right now it has no support to establish revisions to ignore during the
transplant, but it will be easy to add given the current state.

Another not-supported feature is transplanting changes into another project
(tp-to as opposed to tp-from).

Unfortunately, bzr-transplant was already taken, so I took bzr-tp as the project
name in launchapd :)

Oh! And it didn't yet have much testing on real-world projects, so look for the
TODOs and Unimplemented exceptions :)


Thanks,
  Lluis

-- 
 "And it's much the same thing with knowledge, for whenever you learn
 something new, the whole world becomes that much richer."
 -- The Princess of Pure Reason, as told by Norton Juster in The Phantom
 Tollbooth



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: transplant revisions between unrelated projects
  2012-04-17 16:13 transplant revisions between unrelated projects Lluís
@ 2012-04-18 21:42 ` Stefan Monnier
  2012-04-19  0:01   ` Lluís
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2012-04-18 21:42 UTC (permalink / raw)
  To: Lluís; +Cc: bazaar, cedet-devel, emacs-devel

> You can find the code here:
>     https://launchpad.net/bzr-tp/trunk
> This will give some more details on how to use it:
>     bzr help transplant

Could you describe (or point to a description) of what it actually does?


        Stefan



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: transplant revisions between unrelated projects
  2012-04-18 21:42 ` Stefan Monnier
@ 2012-04-19  0:01   ` Lluís
  2012-04-30 13:07     ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Lluís @ 2012-04-19  0:01 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: bazaar, cedet-devel, emacs-devel

Stefan Monnier writes:

>> You can find the code here:
>> https://launchpad.net/bzr-tp/trunk
>> This will give some more details on how to use it:
>> bzr help transplant

> Could you describe (or point to a description) of what it actually does?

Could be seen like an inter-project merge tool, where history is kept (including
merges), as long as the "transplanted" revisions affect files identified as
"transplantable".

For example, emacs->cedet synchronization would transplant files
"lisp/emacs-lisp/eieio\(.*\).el" from emacs into "lisp/eieio/eieio\1.el" in
cedet, where cedet controls what to transplant and when (transplant metadata is
committed into the cedet branch):

  cd /path/to/cedet
  bzr tp-from-init --remember /path/to/emacs
  bzr tp-from-add "lisp/emacs-lisp/eieio\(.*\).el" "lisp/eieio/eieio\1.el"
  bzr tp-from
  # if no conflicts arose:
  bzr tp-from-finish
  # otherwise inspect changes, resolve conflicts, and:
  bzr tp-from-continue

It still does not have support to permanently ignore specific revisions
(although it should be pretty easy to add), and some changes possible in bazaar
are still not handled (e.g., file permissions), but it should already have the
basic support to allow other projects like cedet and gnus to keep in sync with
emacs.

The other functionality that is missing on the cmdline is the "tp-to" family of
commands, which is the inverse set of operations: cedet->emacs transplants, but
keeping the transplant metadata in cedet (although the internals should remain
completely untouched).

As I said, it's not very tested and I won't have much more time to dedicate to
it in the foreseeable future, but I thought the plugin format would benefit more
projects.


Lluis

-- 
 "And it's much the same thing with knowledge, for whenever you learn
 something new, the whole world becomes that much richer."
 -- The Princess of Pure Reason, as told by Norton Juster in The Phantom
 Tollbooth



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: transplant revisions between unrelated projects
  2012-04-19  0:01   ` Lluís
@ 2012-04-30 13:07     ` Stefan Monnier
  2012-05-01 17:53       ` [CEDET-devel] " Lluís
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2012-04-30 13:07 UTC (permalink / raw)
  To: emacs-devel; +Cc: bazaar, cedet-devel

>>> You can find the code here:
>>> https://launchpad.net/bzr-tp/trunk
>>> This will give some more details on how to use it:
>>> bzr help transplant
>> Could you describe (or point to a description) of what it actually does?
> Could be seen like an inter-project merge tool, where history is kept
> (including merges), as long as the "transplanted" revisions affect
> files identified as "transplantable".

> For example, emacs->cedet synchronization would transplant files
> "lisp/emacs-lisp/eieio\(.*\).el" from emacs into
> "lisp/eieio/eieio\1.el" in cedet, where cedet controls what to
> transplant and when (transplant metadata is committed into the cedet
> branch):

I understand that, but I don't understand how it does it.  It seems like
it works a bit like a "rebase".  So, what does "history is kept"
mean exactly?  Will a "bzr tp-from" (once "tp-from-finish"ed) appear
as a merge in the DAG?


        Stefan




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [CEDET-devel] transplant revisions between unrelated projects
  2012-04-30 13:07     ` Stefan Monnier
@ 2012-05-01 17:53       ` Lluís
  0 siblings, 0 replies; 5+ messages in thread
From: Lluís @ 2012-05-01 17:53 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: bazaar, cedet-devel, emacs-devel

Stefan Monnier writes:

>>>> You can find the code here:
>>>> https://launchpad.net/bzr-tp/trunk
>>>> This will give some more details on how to use it:
>>>> bzr help transplant
>>> Could you describe (or point to a description) of what it actually does?
>> Could be seen like an inter-project merge tool, where history is kept
>> (including merges), as long as the "transplanted" revisions affect
>> files identified as "transplantable".

>> For example, emacs->cedet synchronization would transplant files
>> "lisp/emacs-lisp/eieio\(.*\).el" from emacs into
>> "lisp/eieio/eieio\1.el" in cedet, where cedet controls what to
>> transplant and when (transplant metadata is committed into the cedet
>> branch):

> I understand that, but I don't understand how it does it.  It seems like
> it works a bit like a "rebase".  So, what does "history is kept"
> mean exactly?  Will a "bzr tp-from" (once "tp-from-finish"ed) appear
> as a merge in the DAG?

AFAIU it's a mix between rebasing and merging, as the shape of the DAG in the
transplanted revisions from "emacs" should be kept in "cedet".

Example of log showing all levels (-n 0) in "emacs" (c* are the commit
messages):

* c1
* c2
* [merge] c3
  * c4
  * c5
  * c6
* c7

Assuming "c1" was already transplanted into cedet sometime in the past, this is
what you should get after the transplant from "emacs" into "cedet":

* [merge] Transplant from 'emacs': <revid of c2>..<revid of c7>
  * c2
    Transplant from 'emacs': <revid of c2>
  * [merge] c3
    Transplant from 'emacs': <revid of c3>
    * c4
      Transplant from 'emacs': <revid of c4>
    * c5
      Transplant from 'emacs': <revid of c5>
    * c6
      Transplant from 'emacs': <revid of c6>
  * c7
    Transplant from 'emacs': <revid of c7>


Sorry if I haven't used the appropriate bazaar concepts.

You can see the main algorithm here:
  http://bazaar.launchpad.net/~lluis.vilanova/bzr-tp/trunk/view/head:/transplant.py#L250


Lluis

-- 
 "And it's much the same thing with knowledge, for whenever you learn
 something new, the whole world becomes that much richer."
 -- The Princess of Pure Reason, as told by Norton Juster in The Phantom
 Tollbooth



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-05-01 17:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-17 16:13 transplant revisions between unrelated projects Lluís
2012-04-18 21:42 ` Stefan Monnier
2012-04-19  0:01   ` Lluís
2012-04-30 13:07     ` Stefan Monnier
2012-05-01 17:53       ` [CEDET-devel] " Lluís

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).