The find_content function expected a 'project' parameter but never
actually used it. Remove it and clean up tests accordingly.
Signed-off-by: Stephen Finucane
Cc: Paul Jakma
Cc: Tom Rini
---
patchwork/parser.py| 4 ++--
patchwork/tests/test_parser.py | 31 ++---
'auto_delegate' doesn't actually delegate the patches - it merely finds
a suitable delegate based on the filename. Rename the function
accordingly.
'find_delegate' is also renamed to prevent confusion.
Signed-off-by: Stephen Finucane
Cc: Paul Jakma
Cc: Tom Rini
---
patchwork/parser.py | 8 +++
This exposes the hashing functionality of Patchwork without requiring
Django or similar dependencies.
Signed-off-by: Stephen Finucane
Cc: Paul Jakma
Cc: Tom Rini
---
patchwork/hasher.py | 87 +
patchwork/models.py | 52 ++-
These tools are currently broken, but before beginning surgery let's
clean things up. Use standard 4 spaces and the longer, but easier to
read, if-else-fi syntax for comparison.
Missing license headers are added for completeness sake.
Signed-off-by: Stephen Finucane
Cc: Paul Jakma
Cc: Tom Rini
The old 'parser' module used to extract diffs from their surrounding
mbox fluff before hashing this. Seeing as this was only used in the
context of an actual git repo, avoid all of that rigmarole by just using
'git diff', which produces a plain diff, rather than 'git show'.
Signed-off-by: Stephen
There are two scripts provided in tools that reference the removed
hash function of the 'parser' script. Move this hash function back into
its own module and update these scripts to use said module.
Changes since v2:
- Only move the hash function into its own module
- Don't use argparse as it's no
On Tue, 2016-11-29 at 18:53 -0500, Tom Rini wrote:
> On Fri, Nov 18, 2016 at 12:54:52AM +, Stephen Finucane wrote:
>
> > This replaces the older 'parser' main function.
> >
> > Signed-off-by: Stephen Finucane
> > Cc: Paul Jakma
>
> With this series on top of 2941d6f47fd242d53c52e966501fb09
Looks good to me.
Happily this should make the tests a little faster, which is always nice :)
> diff --git a/patchwork/tests/test_parser.py b/patchwork/tests/test_parser.py
> index 96166ad..e4a379d 100644
> --- a/patchwork/tests/test_parser.py
> +++ b/patchwork/tests/test_parser.py
> @@ -62,7 +62
> -delegate = find_delegate(mail)
> +delegate = find_delegate_by_header(mail)
> if not delegate and diff:
> filenames = find_filenames(diff)
> -delegate = auto_delegate(project, filenames)
> +delegate = find_delegate_by_filename(project,
Hi,
> local hash
> -hash=$(git show -C $1 | python $PWDIR/parser.py --hash)
> +hash=$(git diff "$1~..$1" | python $pwpath/hasher.py)
Does this function appropriately in the presence of merge commits? ISTR
they had interesting behaviour and there was a difference between using
~ and u
Hi Stephen,
While you're on a cleaning fix, may I suggest shellcheck.net? No
pressure :)
Regards,
Daniel
Stephen Finucane writes:
> These tools are currently broken, but before beginning surgery let's
> clean things up. Use standard 4 spaces and the longer, but easier to
> read, if-else-fi syn
Hi Stephen,
AFAICT this is mostly a code move, not changing the functionality of the
hasher. On that basis, and seeing how you're using it later on in the
series:
Reviewed-by: Daniel Axtens
Regards,
Daniel
Stephen Finucane writes:
> This exposes the hashing functionality of Patchwork without
Stephen Finucane writes:
> There are two scripts provided in tools that reference the removed
> hash function of the 'parser' script. Move this hash function back into
> its own module and update these scripts to use said module.
So, we need to start doing tests of this stuff - even if it's a se
13 matches
Mail list logo