1 |
On Saturday 25 February 2006 10:40, Alec Warner wrote: |
2 |
> Please review for badness, otherwise I'll commit this soon ;) |
3 |
|
4 |
- self.backupenv = os.environ.copy() |
5 |
- self.configlist.append(self.backupenv) # XXX Why though? |
6 |
- self.configdict["backupenv"]=self.configlist[-1] |
7 |
+ self.configdict["backupenv"]=os.environ.copy() # XXX Why though? ( ferringb? ) |
8 |
|
9 |
Kill this comment altogether. Reading it, my first thought is "why what?" |
10 |
It doesn't make the code clearer and so shouldn't be there. |
11 |
|
12 |
- self.configlist.append(os.environ.copy()) |
13 |
- self.configdict["env"]=self.configlist[-1] |
14 |
+ ### backupenv maybe required to be a clone, and not just a reference |
15 |
+ ### the old code did value copy we do a reference here |
16 |
+ self.configdict["env"]=self.configdict["backupenv"] |
17 |
|
18 |
Again, this comment doesn't make the code clearer and so shouldn't be there. |
19 |
Changing functionality in a "cleanup" patch is also bad form. As for the |
20 |
change itself, it's broken. Look at __setitem__() and reset() and then look |
21 |
at the usage of those two throughout the code. |
22 |
|
23 |
- mydbs=self.configlist[:-1] |
24 |
+ #Abuse the order of lookuplist to emulate old behavior |
25 |
+ mydbs=self.lookuplist[:-1] |
26 |
|
27 |
Same deal with this comment. A person seeing the code for the first time has |
28 |
no idea what the old behaviour was. In the old code, configlist starts with |
29 |
"globals" and ends with "env". In the new (and old) code, lookuplist is the |
30 |
reverse of that. I don't see any further changes to account for this. |
31 |
|
32 |
- if 0 and match and mykey in ["PORTAGE_BINHOST"]: |
33 |
- # These require HTTP Encoding |
34 |
... |
35 |
|
36 |
This shouldn't be in a "cleanup" patch either. |
37 |
|
38 |
-- |
39 |
Jason Stubbs |
40 |
|
41 |
-- |
42 |
gentoo-portage-dev@g.o mailing list |