[Extension] Dirty hack of 'shelve' and 'unshelve' command

Erik Bågfors zindar at gmail.com
Thu May 19 09:19:10 BST 2005


Hi

I think this sounds very interesting. Altough I think having a
pre-commit test instead might be more useful.  I also see the use for
this.  I think this is what makes plugins in bzr so extreamly useful!

I think there are lot's of tools that makes sence to have as plugin
for people who want them instead of having it in the main bzr and make
that more complicated.  This is a great example of this!

Anyway,  This is the first time I try a plugin in bzr and I have no
luck. Here is what happens

: [bagfors at zyrgelkwyt]$ ; bzr shelve
: bad interpreter: No such file or directorysr/bin/python
: bad interpreter: No such file or directorysr/bin/python


: [bagfors at zyrgelkwyt]$ ; ls -l $BZRPATH
total 24
-rw-r--r--  1 bagfors bagfors 9727 2005-05-19 10:05 patches.py
-rw-r--r--  1 bagfors bagfors 3232 2005-05-19 10:06 shelf.py
-rwxr-xr-x  1 bagfors bagfors  261 2005-05-19 10:06 shelve*
-rwxr-xr-x  1 bagfors bagfors  263 2005-05-19 10:06 unshelve*

: [bagfors at zyrgelkwyt]$ ; head -1 $BZRPATH/shelve
#!/usr/bin/python

: [bagfors at zyrgelkwyt]$ ; /usr/bin/python
Python 2.4.1 (#2, Mar 30 2005, 21:51:10)
[GCC 3.3.5 (Debian 1:3.3.5-8ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

So, this looks very strange.  Can this be a UTF-8 problem again? Has
anyone else seen this?

This is interesting also

: [bagfors at zyrgelkwyt]$ ; bzr help shelve
: bad interpreter: No such file or directorysr/bin/python
: bad interpreter: No such file or directorysr/bin/python
usage: shelve


Regards,
Erik


On 5/19/05, Michael Ellerman <michael at ellerman.id.au> wrote:
> Hi All,
> 
> I'm a big nut fan of Darc's support for partial commits. If you've never used
> it, it allows you to choose which hunks of the diff you want to commit - how
> awesome.
> 
> However it has one drawback, which is that it allows you to commit to history
> tree states that never actually existed in your working tree/repository.
> Usually that's exactly why you use it, but it can lead to embarassing errors,
> like if you forget to check in a new file but *do* check in the change to the
> Makefile that references it.
> 
> So I thought I'd try a different interface to solve basically the same
> problem. And so we have the 'shelve' and 'unshelve' commands.
> 
> I know the names a bit dicky, I thought of 'postpone' and 'reinstate' or
> something, but 'shelve' and 'unshelve' are at least obviously symetrical.
> 
> Basically you can run 'bzr shelve' and it will prompt you which hunks you want
> to 'place on the shelf', ie. put away for the moment. You can then make sure
> your tree still builds, run any tests, and then use the regular 'bzr commit'.
> 
> You can the unshelve the hunks on your shelf, and repeat. You end up with more
> or less the same end result as partial commit, but with less chance of error.
> 
> I haven't really used this much yet, so I don't know if I like it. And the
> implementation is very hacky at the moment, it's just a proof of concept.
> 
> I stole Aaron's code for parsing patches, which I think was part of his
> annotate patch, and munged it a bit. Thanks Aaron.
> 
> Stick the attached files in a directory and put that in your $BZRPATH, then yo
> u should be able to run 'shelve' and 'unshelve'.
> 
> Bug reports welcome, although I'm really just throwing this over the wall to
> see if anyone thinks it's a good way of doing this. Let me know.
> 
> cheers
> 
> --
> Michael Ellerman
> IBM OzLabs
> 
> email: michael:ellerman.id.au
> inmsg: mpe:jabber.org
> wwweb: http://michael.ellerman.id.au
> phone: +61 2 6212 1183 (tie line 70 21183)
> 
> We do not inherit the earth from our ancestors,
> we borrow it from our children. - S.M.A.R.T Person
> 
> 
>




More information about the bazaar mailing list