All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Finney <ben+bazaar@benfinney.id.au>
To: bazaar@lists.canonical.com
Cc: git@vger.kernel.org
Subject: Re: Retrieve a specific file from some revision.
Date: Wed, 17 Mar 2010 09:48:14 +1100	[thread overview]
Message-ID: <87eijjx4r5.fsf@benfinney.id.au> (raw)
In-Reply-To: 87vdcwxfit.fsf@newsguy.com

Harry Putnam <reader@newsguy.com> writes:

> I've never used any versioning tool but cvs.  Something I do often
> with cvs is retrieve a previous state of a single file..
>
> Say I wanted to use the hosts file as it was at revision 1.23.

I'll assume, from the Bazaar perspective, that this means “revno 123 of
the branch”. Bazaar tracks snapshot revisions of the working tree as a
whole, unlike CVS's per-file tracking.

> Not just a diff, but the actual file.
> (I would)
>   cd cvsrepo
>     cvs update -p -r1.23 <HOST>/etc/hosts > ~/hosts_HOST_r1.23
>
>   Would create the file as it was at rev. 1.23 for host HOST.
>
> How would I do that in bazaar/git? (which ever newsgroup this is on)

To get the file at revno 123 in the working tree for the branch (the
most normal place for it to appear):

    $ cd bzrbranch/
    $ bzr revert --revision 123 HOST/etc/hosts

You could then copy the file to wherever you actually want to use it.

Alternatively, if you really do want something that emits the file
contents to stdout rather than recreating the file:

    $ cd bzrbranch/
    $ bzr cat --revision 123 HOST/etc/hosts > ~/hosts_HOST_r123

The ‘--revision 123’ option is the verbose spelling of ‘-r 123’.

-- 
 \              “Whatever you do will be insignificant, but it is very |
  `\                    important that you do it.” —Mohandas K. Gandhi |
_o__)                                                                  |
Ben Finney

      parent reply	other threads:[~2010-03-16 22:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-16 18:55 Retrieve a specific file from some revision Harry Putnam
2010-03-16 21:59 ` Martin Langhoff
2010-03-16 22:48 ` Ben Finney [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87eijjx4r5.fsf@benfinney.id.au \
    --to=ben+bazaar@benfinney.id.au \
    --cc=bazaar@lists.canonical.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.