K, good stuff! I'll use what you and Boris came up with and integrate
to mine (will help speed things up) the other project :) and for the
other thing, great idea (i think).  what do you mean by "web
repository"? do you mean reproduce from the code behind a live web2py
server instance? which would be a grand idea! if that's what you mean.
I would doable if a well kept manifest (generated through automation
on "pull") describing in xml format file names (path) and rev # be
installed long with web2py. then a simple xmlrpc meg over https should
get you a nice xml file wich can be used to resolve the variables used
in a hg pull cmd. (at least that's what I'd do to start) - I do
something like that to get build automation to talk to the bug
tracking system (keeps QA happy with reports like "build X contains
THIS list of bug fixes as described in THIS list of changelist
description, which contains THIS list of affected files, which was
checked in by THIS user, and reviewd by etc...."

But, please let me know if I got the requirement all wrong, and I'll
be happy to suggest another approach.



For the diff requirement: I would definitely start fro the bottom up.
This is what I do currently do with Perforce (logic should be
similar).

1) I generate an XML representation of a directory structure (where I
need to be able to specify any folder within my dir structure as the
"root" folder (the starting point), and need to be able to exclude
files and/folders as params to the function call.

2) once I have my xml object (I like a well structured Element Tree
for this type of thing), I will simply pass the elements (in a loop)
to a function that will have the know-how to return a correct mapping
between repository and workspace (i think Mercurial calls this the
Working Directory).

3) diff the file, capture the diff (if any) store it (keeping the the
return strings in order is important, so I keep each return values as
a dictionary within warm brackets of a collection that respects order
(like a deque()).

once done and have gone through the the complete fileset, then it just
depends on how fancy we want to be (color, special indentation, format
to 2 pages, etc..._) or the complete returned values can be formatted
and handed to araxis (or something like that)...

in the .hg word, its a little more convoluted in that I believe
another repository needs to be created and changes pulled from the
from the revision you are interested in (can be any revision or
"latest" but it does need to be specified. Would look something like
this:


mkdir myTempDir
cd myTempDir
hg init
hg pull myTempDir
hg update -r N

then do that recursive diff as discussed above

is this what you were looking for?

Mart :)

connect to app admin through script:
On Oct 24, 9:14 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
> Actually I just did this with some help from Boris from the mercurial
> mailing list.
>
> Now if you run web2py from source ad you have mercurial installed
> (easy_install mercurial) you can use the web2py admin to:
>
> - create a repository (this is done automatically and it also makes
> a .hgignore)
> - commit file
> - see log changes
> - see list of files for each committed revision
> - revert to past revision
>
> (all by just clicking)
>
> One important missing feature is the ability to get a diff vs a given
> revision.
> Another feature I would like to have is the ability to push from a web
> repository or revert to it.
>
> On Oct 24, 8:09 pm, mart <msenecal...@gmail.com> wrote:
>
> > Hi Massimo,
>
> > Ok, now I feel bad...  I have not had the time to finish the
> > integration app I promised... Much is done, but not yet complete...  I
> > still do intend on completing though... hopefully soon...
>
> > Until then, what is your intent here? are you looking to restore a
> > fileset (or entire tree) to a specific version from repo  (without
> > changing meta data), are you looking to drop all meta changes, revert
> > you local code line to known state?
>
> > are you looking for a quick and dirty recipe like with combination of
> > cmds to delete local changesets and revert to a speciic version (or
> > #head revision) of the remote depot? like:
> > delete local repo, then:
> > hg init --> create new
> > hg pull --> get a version
> > hg update  --> well, just update...
>
> > Although, by reading your commit script, I'd say you're pretty handy
> > with mercurial API as it is.
>
> > anyways, depends what you are looking to do... I can give you some
> > quick and dirty recipes if you like, if it helps.
>
> > Mart :)
>
> > On Oct 24, 6:23 pm, Massimo Di Pierro <mdipie...@cs.depaul.edu> wrote:
>
> > > Hello everybody,
>
> > > I am working on improving the web2py web interface to mercurial.
>
> > >http://127.0.0.1:8000/admin/mercurial/commit
>
> > > We can current create a repo, commit and get changelog but I cannot 
> > > figure out how to do revert.
> > > Here is the code I have:
>
> > >    import os
> > >    uio = ui.ui()
> > >    uio.quiet = True
> > >    if not os.environ.get('HGUSER') and not uio.config("ui", "username"):
> > >        os.environ['HGUSER'] = 'web...@localhost'
> > >    try:
> > >        repo = hg.repository(ui=uio, path=path)
> > >    except:
> > >        repo = hg.repository(ui=uio, path=path, create=True)
>
> > > given repo and a revision number from repo.changelog, how to I revert all 
> > > files to that revision using the API?
>
> > > Massimo
>
>

Reply via email to