By expanding the usage of new dim_pull_request_tags
we can move the drm-intel-next specific parts to
dim_pull_request_next and simplify the dim_pull_request
limiting it to only create the tags.

Cc: Daniel Vetter <[email protected]>
Cc: Jani Nikula <[email protected]>
Signed-off-by: Rodrigo Vivi <[email protected]>
---
 dim     | 44 ++++++++++++++------------------------------
 dim.rst |  7 +++----
 2 files changed, 17 insertions(+), 34 deletions(-)

diff --git a/dim b/dim
index b4d7996a1072..6e927850624a 100755
--- a/dim
+++ b/dim
@@ -1930,48 +1930,32 @@ function dim_pull_request_tags
 # dim_pull_request branch upstream
 function dim_pull_request
 {
-       local branch upstream remote repo req_file url_list git_url tag
+       local branch upstream remote repo url_list git_url tag
 
        branch=${1:?$usage}
        upstream=${2:?$usage}
        remote=$(branch_to_remote $branch)
        repo=$(branch_to_repo $branch)
-       req_file=$(mktemp)
-
-       if [ "$branch" != "drm-intel-next" ]; then
-               assert_branch $branch
-       else
-               cd $DIM_PREFIX/$DIM_REPO
-       fi
 
-       git_fetch_helper ${upstream%%/*}
-       echo "Using $upstream as the upstream"
-
-       if [ "$branch" = "drm-intel-next" ]; then
-               # drm-intel-next pulls have been tagged using dim update-next
-               drm_intel_next_tags=$(git log "$branch@{upstream}" ^$upstream 
--decorate | grep "(.*tag: drm-intel-next-" | sed -e "s/^.*(.*tag: 
\(drm-intel-next-[^ ,]*\).*)$/\1/")
-               prep_pull_mail $req_file $drm_intel_next_tags
-               tag=$(git describe --all --exact "$branch@{upstream}")
-       else
-               tag=$(tag_name "$branch")
-               gitk --first-parent "$branch" ^$upstream &
-               tag_branch $tag $branch
-               $DRY git push $remote $tag
-               prep_pull_mail $req_file $tag
-       fi
+       tag=$(tag_name "$branch")
+       gitk --first-parent "$branch" ^$upstream &
+       tag_branch $tag $branch
+       $DRY git push $remote $tag
 
-       url_list=${drm_tip_repos[$repo]}
-       git_url=$(pick_protocol_url git $url_list)
-
-       git request-pull $upstream $git_url $tag >> $req_file
-       $DRY $DIM_MUA -s "[PULL] $branch" \
-            -i $req_file "${dim_pull_request_recipients[@]}"
+       dim_pull_request_tags $branch $upstream $tag
 }
 
 function dim_pull_request_next
 {
+       local drm_intel_next_tags
+
        upstream=${1:-$(branch_to_remote drm-next)/drm-next}
-       dim_pull_request drm-intel-next $upstream
+
+       cd $DIM_PREFIX/$DIM_REPO
+       # drm-intel-next pulls have been tagged using dim update-next
+       drm_intel_next_tags=$(git log "drm-intel-next@{upstream}" ^$upstream 
--decorate | grep "(.*tag: drm-intel-next-" | sed -e "s/^.*(.*tag: 
\(drm-intel-next-[^ ,]*\).*)$/\1/")
+
+       dim_pull_request_tags drm-intel-next $upstream drm_intel_next_tags
 }
 
 function dim_pull_request_fixes
diff --git a/dim.rst b/dim.rst
index 1a9bed464021..6bd2c8ae30c4 100644
--- a/dim.rst
+++ b/dim.rst
@@ -301,10 +301,9 @@ recipients already set.
 
 pull-request *branch* *upstream*
 --------------------------------
-Fetch the *upstream* remote to make sure it's up-to-date, create and push a 
date
-based tag for the *branch*, generate a pull request template with the specified
-*upstream*, and finally start \$DIM_MUA with the template with subject and
-recipients already set.
+Creates and pushes a date based tag for the *branch*. It generates a pull 
request
+template with the specified *upstream*, and finally it starts \$DIM_MUA with 
the
+template with subject and recipients already set.
 
 Since the tag for the *branch* is date based, the pull request can be
 regenerated with the same commands if something goes wrong.
-- 
2.17.1

_______________________________________________
dim-tools mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dim-tools

Reply via email to