FAQ
I have some very simple use cases[1] for adding some version control
capabilities to a product I'm working on. My product uses simple, text
(UTF-8) based scripts that are independent of one another. I would like
to "version control" these scripts on behalf of my users. By version
control, I mean *very-simple* version control with no branching or
merging - just the ability to store, list and restore a specific version
of a file. The data store should be a local file with the ability to
upsize to a multi-user database in the future.

I'm looking for recommendations on possible solutions:

1. Use an existing version control utility. There are lots of options
here(!), any recommendations on a light weight, open source one that
xcopy installs under Windows with lots of command line options?

2. Interface to a hosted version control system (SaaS) that provides a
RESTful API. Any recommendations here?

3. Build this capability myself using Python and Python's DBI layer to
store files in a local SQLite database at first (but with the ability to
upsize to a real client server database in the future). Seems like a fun
project to work on, but also smells like I'd be re-inventing the wheel
with very little value added other than simpler deployment?

Any suggestions appreciated.

Malcolm

[1] Here's my use cases:

1. Check a file in with optional comment and username; ideally
get a version number that can be used to reference this specific
check-in in the future.

2. Get a history listing of all checkins for a specific file
(version number, timestamp, file size, user, comment)

3. Check out a specific version of a file by version number.

4. Delete checked-in versions by version number, date range,
and/or username.

5. (Optional) Diff 2 versions of a file by version number and
return diff in richly formatted format that visually shows
changes via color and font effects (strikethru) (I'm thinking
of using BeyondCompare for this if not present in a simple
version control tool)

Search Discussions

  • Thomas Jollans at Jul 23, 2010 at 8:49 pm

    On 07/23/2010 10:35 PM, python at bdurham.com wrote:
    1. Use an existing version control utility. There are lots of options
    here(!), any recommendations on a light weight, open source one that
    xcopy installs under Windows with lots of command line options?
    You could just go with Mercurial, you know. Very popular, powerful,
    portable, distributed (so you need no server infrastructure...), free
    software of course, and written in Python, so interfacing it from Python
    isn't that hard. It also scales up and down very well, so you can easily
    change your mind about what you want it to do later if you want to.
    1. Check a file in with optional comment and username; ideally
    get a version number that can be used to reference this specific
    check-in in the future. trivial.
    2. Get a history listing of all checkins for a specific file
    (version number, timestamp, file size, user, comment)
    trivial as in that's the whole point.
    3. Check out a specific version of a file by version number.
    Mercurial, and the other distributed VCS, don't technically track
    changes to files, they track changes to the whole repository (think
    "directory" if you're not acquainted with DVCS) -- as with any other
    existing solution you might use, you'll have to think a bit more on its
    (whatever tool you end up using) terms.
    4. Delete checked-in versions by version number, date range,
    and/or username.
    Do you really want to do this? It's possible, even with Mercurial, but
    do you really want to create history just to delete it later? Think
    about it.
    5. (Optional) Diff 2 versions of a file by version number and
    return diff in richly formatted format that visually shows
    changes via color and font effects (strikethru) (I'm thinking
    of using BeyondCompare for this if not present in a simple
    version control tool)
    Yeah, just look for a nice graphical diff tool. KDiff3 springs to mind,
    I think that's what comes bundled with TortoiseHg on Windows.
  • Anssi Saari at Jul 25, 2010 at 12:47 pm

    python at bdurham.com writes:

    1. Use an existing version control utility. There are lots of options
    here(!), any recommendations on a light weight, open source one that
    xcopy installs under Windows with lots of command line options?
    Personally, I like RCS. It seems fulfil your requirements. You can get
    it for Windows from http://www.cs.purdue.edu/homes/trinkle/RCS/.
  • Günther Dietrich at Jul 25, 2010 at 6:42 pm

    python at bdurham.com wrote:
    I have some very simple use cases[1] for adding some version control
    capabilities to a product I'm working on. My product uses simple, text
    (UTF-8) based scripts that are independent of one another. I would like
    to "version control" these scripts on behalf of my users. By version
    control, I mean *very-simple* version control with no branching or
    merging - just the ability to store, list and restore a specific version
    of a file. The data store should be a local file with the ability to
    upsize to a multi-user database in the future.

    I'm looking for recommendations on possible solutions:

    1. Use an existing version control utility. There are lots of options
    here(!), any recommendations on a light weight, open source one that
    xcopy installs under Windows with lots of command line options?

    2. Interface to a hosted version control system (SaaS) that provides a
    RESTful API. Any recommendations here?

    3. Build this capability myself using Python and Python's DBI layer to
    store files in a local SQLite database at first (but with the ability to
    upsize to a real client server database in the future). Seems like a fun
    project to work on, but also smells like I'd be re-inventing the wheel
    with very little value added other than simpler deployment?

    Any suggestions appreciated.
    Use Mercurial (<http://mercurial.selenic.com>). It is written in python,
    can be extended by python modules/packages and can be used by python
    programs directly.

    1. Check a file in with optional comment and username; ideally
    get a version number that can be used to reference this specific
    check-in in the future.
    That's a basic task in mercurial (as probably in every version control
    system).

    2. Get a history listing of all checkins for a specific file
    (version number, timestamp, file size, user, comment)
    Also avalilable. I am not sure about file size and comment, but if you
    have the list of version numbers, you can extract this info from the
    repository easily.

    3. Check out a specific version of a file by version number.
    See point 1.

    4. Delete checked-in versions by version number, date range,
    and/or username.
    I've never tried it with mercurial. There are a remove and a forget
    command. Maybe, one could use the rebase extension.

    But deleting changesets from a repository usually is a bad idea.

    5. (Optional) Diff 2 versions of a file by version number and
    return diff in richly formatted format that visually shows
    changes via color and font effects (strikethru) (I'm thinking
    of using BeyondCompare for this if not present in a simple
    version control tool)
    Also available.



    Regards,

    G?nther
  • Ben Finney at Jul 26, 2010 at 1:04 am

    "G?nther Dietrich" <gd.usenet at spamfence.net> writes:

    python at bdurham.com wrote:
    I have some very simple use cases[1] for adding some version control
    capabilities to a product I'm working on.
    [?]
    I'm looking for recommendations on possible solutions:

    1. Use an existing version control utility.
    [?]
    Use Mercurial (<http://mercurial.selenic.com>). It is written in
    python, can be extended by python modules/packages and can be used by
    python programs directly.
    Either of Mercurial or Bazaar <URL:http://bazaar.canonical.com/> will be
    good choices for the requirements specified.

    All of G?nther's comments (including those I trimmed in this reply)
    apply equally to both Mercurial and Bazaar. You might like to ask
    questions in each of the support forums for those tools for more
    information.

    --
    \ ?To punish me for my contempt of authority, Fate has made me an |
    `\ authority myself.? ?Albert Einstein, 1930-09-18 |
    _o__) |
    Ben Finney

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedJul 23, '10 at 8:35p
activeJul 26, '10 at 1:04a
posts5
users5
websitepython.org

People

Translate

site design / logo © 2022 Grokbase