Discussion:
[Be-devel] [PATCH] Incorrect accquiring bugdir command line argument
Matěj Cepl
2013-10-31 10:57:36 UTC
Permalink
The calling below seems like a typo to me. How can we index with
a variable which has not been initialized yet?

Best,

Mat?j Cepl

Signed-off-by: Mat?j Cepl <mcepl at redhat.com>
---
libbe/command/new.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libbe/command/new.py b/libbe/command/new.py
index 6e94e79..33ede50 100644
--- a/libbe/command/new.py
+++ b/libbe/command/new.py
@@ -118,7 +118,7 @@ class New (libbe.command.Command):
storage = self._get_storage()
bugdirs = self._get_bugdirs()
if params['bugdir']:
- bugdir = bugdirs[bugdir]
+ bugdir = bugdirs[params['bugdir']]
elif len(bugdirs) == 1:
bugdir = bugdirs.values()[0]
else:
--
1.8.4.1.600.g3d092bf
W. Trevor King
2013-10-31 15:00:33 UTC
Permalink
Post by Matěj Cepl
Signed-off-by: Mat?j Cepl <mcepl at redhat.com>
We don't have any Developer Certificate of Origin documentation in
this repository, so I'll drop the SOB when I apply this.
Post by Matěj Cepl
--- a/libbe/command/new.py
+++ b/libbe/command/new.py
storage = self._get_storage()
bugdirs = self._get_bugdirs()
- bugdir = bugdirs[bugdir]
+ bugdir = bugdirs[params['bugdir']]
bugdir = bugdirs.values()[0]
Oops, nice catch. It looks like there are a few more instances of
this as well:

$ git grep 'bugdir = bugdirs\['
libbe/command/new.py: bugdir = bugdirs[bugdir]
libbe/command/set.py: bugdir = bugdirs[bugdir]
libbe/command/target.py: bugdir = bugdirs[bugdir]
?

Would you like to reroll fixing all of those?

Cheers,
Trevor
--
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://void.printf.net/pipermail/be-devel/attachments/20131031/61574cd5/attachment.pgp>
Matěj Cepl
2013-10-31 17:46:09 UTC
Permalink
Yes, I caught two more. You were right.

Here we are,

Mat??j

---
libbe/command/new.py | 2 +-
libbe/command/set.py | 2 +-
libbe/command/target.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libbe/command/new.py b/libbe/command/new.py
index 6e94e79..33ede50 100644
--- a/libbe/command/new.py
+++ b/libbe/command/new.py
@@ -118,7 +118,7 @@ class New (libbe.command.Command):
storage = self._get_storage()
bugdirs = self._get_bugdirs()
if params['bugdir']:
- bugdir = bugdirs[bugdir]
+ bugdir = bugdirs[params['bugdir']]
elif len(bugdirs) == 1:
bugdir = bugdirs.values()[0]
else:
diff --git a/libbe/command/set.py b/libbe/command/set.py
index 9413a13..d552878 100644
--- a/libbe/command/set.py
+++ b/libbe/command/set.py
@@ -77,7 +77,7 @@ class Set (libbe.command.Command):
def _run(self, **params):
bugdirs = self._get_bugdirs()
if params['bugdir']:
- bugdir = bugdirs[bugdir]
+ bugdir = bugdirs[params['bugdir']]
elif len(bugdirs) == 1:
bugdir = bugdirs.values()[0]
else:
diff --git a/libbe/command/target.py b/libbe/command/target.py
index 20ffb57..9f76303 100644
--- a/libbe/command/target.py
+++ b/libbe/command/target.py
@@ -99,7 +99,7 @@ class Target (libbe.command.Command):
bugdirs = self._get_bugdirs()
if params['resolve'] == True:
if params['bugdir']:
- bugdir = bugdirs[bugdir]
+ bugdir = bugdirs[params['bugdir']]
elif len(bugdirs) == 1:
bugdir = bugdirs.values()[0]
else:
--
1.8.4.1.600.g3d092bf
Matěj Cepl
2013-10-31 22:11:36 UTC
Permalink
You might want to check your MUA config, since 'git am ?' was giving
My "MUA" in this case was git-send-email(1) ;), and that bad MIME was a
result of my thinking it was "Are you sure" prompt.

Best,

Mat?j
--
http://www.ceplovi.cz/matej/, Jabber: mcepl at ceplovi.cz
GPG Finger: 89EF 4BC6 288A BF43 1BAB 25C3 E09F EF25 D964 84AC

Home is where ~/.bashrc is.
-- from Usenet

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 255 bytes
Desc: OpenPGP digital signature
URL: <http://void.printf.net/pipermail/be-devel/attachments/20131031/2ba29e7b/attachment.pgp>
Loading...