gnu-arch-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnu-arch-users] PyArch newbie observations/questions


From: Aaron Bentley
Subject: Re: [Gnu-arch-users] PyArch newbie observations/questions
Date: Mon, 31 May 2004 09:18:14 -0400
User-agent: Mozilla Thunderbird 0.5 (X11/20040309)

David Allouche wrote:
Well, it could be
def delta(self, from=tree_latest_revision(), to=tree_root(), output=None):

With no arguments or with just "to" specified, it would behave like changes.


I'll drop pedantic mode for a moment, you seem to mean (using my made up
syntax, which avoids the ambiguities and bugs in your prototype):

    arch.ArchSourceTree.delta
        [from: Revision, default: self tree-revision]
        [to: Revision|ArchSourceTree, default: self]
        [output: DirName, default: /tmp/something then remove it]

No, I don't think it should be a member of ArchSourceTree.

Let me hit again the nail about the the underspecified "output"
argument. Omitting it only makes sense for CHANGES where there is an
expected default dirname, or if there is a way to get the stdout result
of the command, which your prototype does not provide.

Okay, I admit I want incremental output to go to stdout. I disagree with defaulting to /tmp/something because it's not clear then whether it should be removed afterward

Also putting the file in /tmp will probably annoy people who use /tmp
over NFS. I know that's a stupid thing to do, but from what I can read
here, there are a lot of stupid and weird setups around.

Well, there are environment variables folks can set if they don't want to use tmp. I'm using mkdtmp, which should honour those lifestyle choices.

Anyway, I'm not going to implement it or accept it that way. DELTA
must be allowed to operate without a ArchSourceTree being available, so
it must be a module-level funtion, regardless of additional arguments
about symmetric polymorphism or mysticsm that I could come up with.

Okay. I'll keep using tla delta directly until we can framework it properly.

 1. CHANGES can save its output changeset under a default name in the
    tree-root, named after the master revision.

True.  I'm not aware of a use for this, though.


What about implementing alternative changeset serialization commands?

That would be valuable, but you'd want to know what the output directory name was, so you'd provide one.

 4. CHANGES is used in different contexts than DELTA,

I think delta could be used in the same places just as conveniently, if it had sensible defaults.


If your sensible defaults involve making delta a method of
ArchSourceTree, I do not consider them sensible.

No, I (think I) meant it to be a free function.

The changeset output is nice to have for Pyaba. To colorize it the right way, we'd need to parse the leading letters.


Are you talking about the --diffs output or about the incremental output
(where the leading letters are indeed important)?

Incremental output.

That could be supported using an extended version of
arch.util.StringOutput (passed as a keword argument to
arch.WorkingTree.changes and arch.delta), but that would need much more
reflexion to get it right.

It seems to me that we'd want a per change iterator.


I was rather thinking about a more general mechanism for methods which
provide incremental output one could want to monitor. For example
library-add and changeset-applying functions.

Ah. I don't rightly know how to handle those. Sounds like a multithreaded thing to me.

I didn't even know Python lacked destructors 'till today. I miss RAII already.


There are destructors, they are just different from C++ dtors.

You know, the Python tutorial has certain features in common with the Arch tutorial. I especially like the bit when it says there are no constructors or private methods. And then goes on to describe __init__.


This is the __del__ special method.
http://docs.python.org/ref/customization.html#l2h-174

Thanks.

Here's a PyArch-specific issue. I could ship pyaba with PyArch in a subdirectory. I'd forward any revisions that affected PyArch to you, of course.


For the time being, I think that's the way to go. We'll iron out
specific issues later.

Okay, I've done it this way. "pyaba--dist--0" It includes aba too. This is laughably easy to install. For development, I'm using separate trees, to keep my changesets untangled.

Aaron

--
Aaron Bentley
Director of Technology
Panometrics, Inc.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]