Question about Source Control

Cameron Simpson cs at zip.com.au
Fri Mar 21 07:00:50 CET 2014


On 21Mar2014 07:40, Frank Millman <frank at chagford.com> wrote:
> "Cameron Simpson" <cs at zip.com.au> wrote in message 
> news:20140321013313.GA58343 at cskk.homeip.net...
> > Someone intending to clone the project and develop will probably
> > want the whole repository; as Gregory says - they can then easily
> > push/pull with others.
> >
> > For Frank, the size of the repo is not the size of the bare code *
> > number of changesets. There are many diff-level steps in there,
> > making for a much smaller size. And code is small; really really
> > small.
> 
> Ok, I think I've got it.
> 
> To make the software available to anyone who just wants to run a stable 
> version, copy the working directory of the 'major release' repository to a 
> directory of its own, without the .hg stuff, and make it available for 
> download.

See "hg archive". It does exactly that for you. Run "hg help archive".
It will also make tarballs and other archive formats.

> For everyone else, just make the full repository available, and don't worry 
> about the size.
> 
> 'Everyone else' would include those wishing to collaborate on the project, 
> and those who just wish to keep up to date with the latest updates.
> 
> Actually my concern was not the 'size' of the full repository, but the 
> prospect of wading through thousands of changesets most of which are ancient 
> history. However, I assume that the experienced user will adopt habits such 
> as 'hg log tip:-10' to review the last 10 changesets, so it should not be a 
> problem.

Yep.

Also see "hg blame". (Run "hg help blame" for usage info.)

For example, inside my "hg/css" repository I can say:

  hg blame bin/set-x

and the output goes:

    [hg/css]fleet*> hg blame bin/set-x
     2186: #!/bin/sh
    11359: #
    11359: # Trace execution of a command.

and so on the the end of the file. That tells me when those lines
of the file were last modified (by local changeset number). You
could pick a line in the file that you're interested in and look
at log entries for that.

For example, taking "11359" from the above listing, I can go:

    [hg/css]fleet*> hg log -r 11359
    changeset:   11359:136315cc8ec5
    user:        Cameron Simpson <cs at zip.com.au>
    date:        Wed Mar 05 10:37:09 2014 +1100
    files:       bin/set-x
    description:
    set-x: add --date option to timestamp command start and end, upgrade option parsing logic

That is for the whole changeset, but it happens to affect just that one
file.

Alternatively, although there may be many many changes, for some
files it is not so noisy. You might go:

    hg log bin/set-x

to show only changes involving that particular file.

Cheers,
-- 
Cameron Simpson <cs at zip.com.au>

The aim of AI is to make computers act like the ones in the movies.
        - Graham Mann



More information about the Python-list mailing list