How to use shelf1?

Óscar Fuentes ofv at wanadoo.es
Thu Dec 3 21:16:12 GMT 2009


John Arbash Meinel <john at arbash-meinel.com> writes:

>>> So as an emacs developer, I would assume you tend to edit *in* emacs.
>>>
>>> How would you specify the diff hunks in a non-interactive way?
>> 
>> Emacs would show the output of `bzr diff'. Emacs knows how to work with
>> a diff hunk at a time or with a list of hunks. The user would mark the
>> hunks he wants to shelve. Then, Emacs builds a file with a format like
>> this:
>> 
>> filename @@ -94,6 +94,12 @@
>> otherfile @@ -100,6 +115,12 @@
>> 
>> and is passed to bzr shelve:
>> 
>> bzr shelve -F file-with-hunk-headers
>> 
>> which proceeds to shelve those hunks. If some listed hunk is unknown to
>> bazaar, it bails out.
>
> I don't know how the specific formatting would be, etc.

The format is exactly like the above. How much info bzr needs for
identifying the hunks to be shelved? It starts to operate as always, but
instead of showing the hunk on the console and asking the user, it
checks if the hunk's header matches any listed on the file. If yes,
shelve it, if not, ignore it.

> It also seems like it would depend heavily on emacs being able to
> easily output a file of the right format. And I don't know what that
> requires on the emacs side. (a plugin, a specific mode, etc) Is there
> a standard one already?

Emacs already has all the required infrastructure.

>> Another feature that people is asking for is an option for `bzr
>> unshelve' that does not remove the shelve afterwards. The git people
>> have `git stash apply' for that. It is very handy sometimes and I
>> guess that is trivial to implement. Shall I create a feature request
>> for it on launchpad?
>> 
>
> Yes. Probably 2 separate requests. 1 to support shelve -F, another to
> support unshelve --keep-shelf.

Done:

Support for unshelve --keep :
https://bugs.launchpad.net/bzr/+bug/492095

Support for shelve -F :
https://bugs.launchpad.net/bzr/+bug/492091

-- 
Óscar



More information about the bazaar mailing list