[ 
https://issues.apache.org/jira/browse/YETUS-57?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kengo Seki updated YETUS-57:
----------------------------
    Attachment: YETUS-57.01.patch

Attaching a revised patch. (Point out if I misunderstand your comment)

If basedir is a subdirectory of patch-dir, patch-dir should not be removed:

{code}
[sekikn@mobile yetus]$ ls -l ..
total 0
drwxr-xr-x  25 sekikn  staff  850 Nov  1 23:47 hadoop
drwxr-xr-x  14 sekikn  staff  476 Nov  1 22:27 yetus
[sekikn@mobile yetus]$ precommit/test-patch.sh --basedir=../hadoop 
--patch-dir=.. --project=hadoop --resetrepo HADOOP-12070

(snip)

Applying the patch:
Mon Nov  2 00:01:33 JST 2015
cd /Users/sekikn/dev/hadoop
git apply --binary -v --stat --apply -p0 /Users/sekikn/dev/patch
Applied patch hadoop-common-project/hadoop-common/src/main/bin/hadoop.cmd 
cleanly.
 .../hadoop-common/src/main/bin/hadoop.cmd          |   26 ++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

(snip)

[sekikn@mobile yetus]$ ls -l ..
total 416
-rw-r--r--   1 sekikn  staff     413 Nov  2 00:01 apply-patch-git-apply.log
-rw-r--r--   1 sekikn  staff    2416 Nov  2 00:01 gitdiffcontent.txt
-rw-r--r--   1 sekikn  staff    1608 Nov  2 00:01 gitdifflines.txt
-rw-r--r--   1 sekikn  staff    2405 Nov  2 00:01 gitdiffunilines.txt
drwxr-xr-x  26 sekikn  staff     884 Nov  2 00:01 hadoop
-rw-r--r--   1 sekikn  staff   73263 Nov  2 00:01 jira
-rw-r--r--   1 sekikn  staff    2742 Nov  2 00:01 patch
-rw-r--r--   1 sekikn  staff  114366 Nov  2 00:02 patch-asflicense-root.txt
-rw-r--r--   1 sekikn  staff     193 Nov  2 00:01 patch-dryrun.log
-rw-r--r--   1 sekikn  staff       0 Nov  2 00:01 whitespace-eol.txt
-rw-r--r--   1 sekikn  staff       0 Nov  2 00:01 whitespace-tabs.txt
drwxr-xr-x  14 sekikn  staff     476 Nov  1 22:27 yetus
[sekikn@mobile yetus]$ precommit/test-patch.sh --basedir=../hadoop 
--patch-dir=.. --project=hadoop --resetrepo HADOOP-12070 --debug
[Mon Nov  2 00:03:38 JST 2015 DEBUG]: Start clock
[Mon Nov  2 00:03:38 JST 2015 DEBUG]: The patch directory .. already exists.
[Mon Nov  2 00:03:38 JST 2015 DEBUG]: Don't touch .. because BASEDIR is its 
subdirectory.

(snip)

Applying the patch:
Mon Nov  2 00:01:33 JST 2015
cd /Users/sekikn/dev/hadoop
git apply --binary -v --stat --apply -p0 /Users/sekikn/dev/patch
Applied patch hadoop-common-project/hadoop-common/src/main/bin/hadoop.cmd 
cleanly.
 .../hadoop-common/src/main/bin/hadoop.cmd          |   26 ++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)
Mon Nov  2 00:03:47 JST 2015
cd /Users/sekikn/dev/hadoop
git apply --binary -v --stat --apply -p0 /Users/sekikn/dev/patch
Applied patch hadoop-common-project/hadoop-common/src/main/bin/hadoop.cmd 
cleanly.
 .../hadoop-common/src/main/bin/hadoop.cmd          |   26 ++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

(snip)
{code}

If basedir isn't a subdirectory of patch-dir and the user isn't in re-exec 
mode, patch-dir should be removed:

{code}
[sekikn@mobile yetus]$ precommit/test-patch.sh --basedir=../hadoop 
--patch-dir=/Users/sekikn/p --project=hadoop --resetrepo HADOOP-12070
Removing contents in /Users/sekikn/p

(snip)

Applying the patch:
Mon Nov  2 00:05:31 JST 2015
cd /Users/sekikn/dev/hadoop
git apply --binary -v --stat --apply -p0 /Users/sekikn/p/patch
Applied patch hadoop-common-project/hadoop-common/src/main/bin/hadoop.cmd 
cleanly.
 .../hadoop-common/src/main/bin/hadoop.cmd          |   26 ++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

(snip)
{code}

If basedir isn't a subdirectory of patch-dir and the user is in re-exec mode, 
patch-dir should not be removed:

{code}
[sekikn@mobile yetus]$ precommit/test-patch.sh --build-tool=nobuild 
--patch-dir=/Users/sekikn/p --plugins=all --resetrepo YETUS-78 --debug

(snip)

============================================================================
============================================================================
                         precommit patch detected
============================================================================
============================================================================




============================================================================
============================================================================
                         Applying patch to master
============================================================================
============================================================================


Applying the patch:
Mon Nov  2 00:06:51 JST 2015
cd /Users/sekikn/dev/yetus
git apply --binary -v --stat --apply -p1 /Users/sekikn/p/patch
Applied patch precommit/personality/orc.sh cleanly.
 precommit/personality/orc.sh |   29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
[Mon Nov  2 00:06:51 JST 2015 DEBUG]: copying 
'/Users/sekikn/dev/yetus/precommit' over to '/Users/sekikn/p/precommit'
[Mon Nov  2 00:06:52 JST 2015 DEBUG]: copying 
'/Users/sekikn/dev/yetus/precommit/test-patch-docker/Dockerfile-startstub' over 
to '/Users/sekikn/p/precommit/test-patch-docker/Dockerfile'
[Mon Nov  2 00:06:52 JST 2015 DEBUG]: Stop clock
[Mon Nov  2 00:06:52 JST 2015 DEBUG]: add_vote_table 0 reexec precommit patch 
detected.
[Mon Nov  2 00:06:52 JST 2015 DEBUG]: The patch directory /Users/sekikn/p 
already exists.
[Mon Nov  2 00:06:52 JST 2015 DEBUG]: Don't touch /Users/sekikn/p because we're 
in re-exec mode.

(snip)

Applying the patch:
Mon Nov  2 00:06:51 JST 2015
cd /Users/sekikn/dev/yetus
git apply --binary -v --stat --apply -p1 /Users/sekikn/p/patch
Applied patch precommit/personality/orc.sh cleanly.
 precommit/personality/orc.sh |   29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
Mon Nov  2 00:06:59 JST 2015
cd /Users/sekikn/dev/yetus
git apply --binary -v --stat --apply -p1 /Users/sekikn/p/patch
Applied patch precommit/personality/orc.sh cleanly.
 precommit/personality/orc.sh |   29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

(snip)
{code}

> empty patch_dir if not in re-exec mode?
> ---------------------------------------
>
>                 Key: YETUS-57
>                 URL: https://issues.apache.org/jira/browse/YETUS-57
>             Project: Yetus
>          Issue Type: Bug
>          Components: Test Patch
>            Reporter: Allen Wittenauer
>            Assignee: Kengo Seki
>         Attachments: YETUS-57.00.patch, YETUS-57.01.patch
>
>
> test-patch behaves in surprising ways if the patch processing directory isn't 
> empty on execution.  This should probably be fixed, keeping in mind that 
> reexec mode will place some things there.  We should probably check if we are 
> re-execing and if not, either error or clean it out.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to