Reverting to first revision, temporarily

Eric Siegerman lists08-bzr at davor.org
Wed Apr 13 14:06:13 UTC 2011


On Wed, 2011-04-13 at 09:31 +0200, John Arbash Meinel wrote:
> On 04/13/2011 09:18 AM, Krilin Wantun wrote:
> > Hello, I need to install in a server the original version of a
project,
> > but after that I need to keep working on the last revision,
>
> You can always use "bzr revert -r 1" to change your current state to
the
> first revision, and then "bzr revert" to change it back to the latest
> revision.
> 
> I know there is the 'bzr-upload' plugin [...]

For those who can't use bzr-upload for some reason, an
alternative to the "revert" dance would be to do any of these:
    bzr branch -r 1 branch tempdir
    bzr checkout --lightweight -r 1 branch tempdir
    bzr export -r 1 branch tempdir
then upload tempdir.  When you're done with it, tempdir can
simply be deleted.

That avoids messing with your normal working tree, and ensures
that what gets uploaded to the server is a *pristine* copy of r1.
The "revert" approach, by contrast, would also upload any
uncommitted changes and untracked files you happened to have in
your working tree at the time.

Bonus: with either a branch or checkout (but not, obviously, with
an export), the uploaded copy will have a .bzr that accurately
reflects what's in the tree; with "bzr revert -r 1", that won't
be the case.

Choose between those alternatives based on the usual criteria,
plus one more: with a standalone branch, the server's copy will
have enough Bazaar metadata to let you commit any hotfixes you
might make directly on the server, for later merging back into
your mainline.

(Direct-on-server hotfixes aren't necessarily a practice I'd
recommend!, but sometimes they're necessary in emergencies, and
some folks who don't share my aversion to that way of doing
things, do it as a more-or-less normal part of their workflow.
Either way, committing such changes as you make them lets Bazaar
help you to untangle the mess later.)

  - Eric





More information about the bazaar mailing list