[BZR Tree!] [PATCH (haha)] Updated shelf
Michael Ellerman
michael at ellerman.id.au
Fri Jun 17 12:17:33 BST 2005
On Fri, 17 Jun 2005 04:36 pm, John Arbash Meinel wrote:
> There is one small bug in my patch.
>
> >+def print_diff_status(branch):
> >+ from bzrlib.diff import show_diff_trees
> >+ print 'Diff status is now:'
> >+ p = os.popen('diffstat', 'wb')
>
> This line should be
>
> + p = os.popen('diffstat', 'w')
>
> No 'b'. popen doesn't like the binary flag.
>
> Also, on my Mac, when I try to use bzr shelve/unshelve (even the
> original, not my modified version), patch complains that there is a
> missing header. I'm guessing patch wants the *** line, but I'm not
> really sure.
Oops, no that's cause I'm a goose.
I use a local patch to bzr to produce -p1 format patches (ie. a/foo vs b/foo),
and I forgot to revert that before I sent the shelf code up.
It's fixed now on my site. And here's the patch:
cheers
*** modified file 'shelf.py'
--- a/shelf.py
+++ b/shelf.py
@@ -37,7 +37,7 @@
patch = open(shelf, 'r').read()
print >>sys.stderr, "Reapplying shelved patches"
- pipe = os.popen('patch -d %s -s -p1' % root, 'w')
+ pipe = os.popen('patch -d %s -s -p0' % root, 'w')
pipe.write(patch)
pipe.flush()
@@ -77,7 +77,7 @@
shelf.close()
print >>sys.stderr, "Reverting shelved patches"
- pipe = os.popen('patch -d %s -sR -p1' % root, 'w')
+ pipe = os.popen('patch -d %s -sR -p0' % root, 'w')
for patch in patches:
pipe.write(str(patch))
pipe.flush()
--
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