Patchwork p4: drop an assignment that is never used

login
register
mail settings
Submitter Jun Wu
Date Dec. 19, 2016, 10:23 p.m.
Message ID <a99748ec71eb65b50dab.1482186223@x1c>
Download mbox | patch
Permalink /patch/17971/
State Accepted
Headers show

Comments

Jun Wu - Dec. 19, 2016, 10:23 p.m.
# HG changeset patch
# User Jun Wu <quark@fb.com>
# Date 1482186162 0
#      Mon Dec 19 22:22:42 2016 +0000
# Node ID a99748ec71eb65b50dabf1d73ab9de0c6b9124b2
# Parent  935092e525b0ee5656d0830162a1c2adf8248de3
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r a99748ec71eb
p4: drop an assignment that is never used

Discovered by pyflakes:

  hgext/convert/p4.py:305: local variable 'shortdesc' is assigned to but
  never used
Augie Fackler - Dec. 20, 2016, 7:33 p.m.
On Mon, Dec 19, 2016 at 10:23:43PM +0000, Jun Wu wrote:
> # HG changeset patch
> # User Jun Wu <quark@fb.com>
> # Date 1482186162 0
> #      Mon Dec 19 22:22:42 2016 +0000
> # Node ID a99748ec71eb65b50dabf1d73ab9de0c6b9124b2
> # Parent  935092e525b0ee5656d0830162a1c2adf8248de3
> # Available At https://bitbucket.org/quark-zju/hg-draft
> #              hg pull https://bitbucket.org/quark-zju/hg-draft -r a99748ec71eb
> p4: drop an assignment that is never used

Yuya beat you to it: 32a07b8a9f7

(queued so the bot knows this is handled)

>
> Discovered by pyflakes:
>
>   hgext/convert/p4.py:305: local variable 'shortdesc' is assigned to but
>   never used
>
> diff --git a/hgext/convert/p4.py b/hgext/convert/p4.py
> --- a/hgext/convert/p4.py
> +++ b/hgext/convert/p4.py
> @@ -303,6 +303,4 @@ class p4_source(common.converter_source)
>          """
>          desc = self.recode(obj.get("desc", ""))
> -        shortdesc = desc.split("\n", 1)[0]
> -
>          date = (int(obj["time"]), 0)     # timezone not set
>          if parents is None:
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

diff --git a/hgext/convert/p4.py b/hgext/convert/p4.py
--- a/hgext/convert/p4.py
+++ b/hgext/convert/p4.py
@@ -303,6 +303,4 @@  class p4_source(common.converter_source)
         """
         desc = self.recode(obj.get("desc", ""))
-        shortdesc = desc.split("\n", 1)[0]
-
         date = (int(obj["time"]), 0)     # timezone not set
         if parents is None: