zz-export-pull-requests 0.3.8 → 0.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/epr +12 -3
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: beed724fb1aff96563cc82b34e991f10060e6ea7fe9c0387297e73b2c28bc762
|
|
4
|
+
data.tar.gz: 67c5554c4ccd7fb44d3357fee122a2afe11c527a7f6638a7bf19d7fcd730db0e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f268c94678fd04cf6c1ea572eff9a892afda085c847d83251e4349c6712a478ee65eeea3e414f508d9deb56dbe04794c0c666c357061c166ab173747792615cc
|
|
7
|
+
data.tar.gz: afaa31d97c97e9719c1692e7a14f495da21ad83e163d23c59c91e69ab4d3e972e73d7da7ea1070542062e7f689abb52a831f9baf9661da7d3828bb01e011efb3
|
data/bin/epr
CHANGED
|
@@ -9,7 +9,7 @@ require "github_api"
|
|
|
9
9
|
require "gitlab"
|
|
10
10
|
require "bitbucket_rest_api"
|
|
11
11
|
|
|
12
|
-
VERSION = "0.3.
|
|
12
|
+
VERSION = "0.3.9"
|
|
13
13
|
SERVICES = %w[github gitlab bitbucket]
|
|
14
14
|
GIT_CONFIGS = %w[epr.token github.oauth-token]
|
|
15
15
|
|
|
@@ -55,6 +55,14 @@ def lookup_token
|
|
|
55
55
|
end
|
|
56
56
|
end
|
|
57
57
|
|
|
58
|
+
def extract_hash_from_diff(user, repo, diff_link)
|
|
59
|
+
str1 = diff_link.split("..")
|
|
60
|
+
str2 = str1[1].split("?")
|
|
61
|
+
short_hash = str2[0]
|
|
62
|
+
long_hash = get_full_hash(user, repo, short_hash)
|
|
63
|
+
return long_hash
|
|
64
|
+
end
|
|
65
|
+
|
|
58
66
|
def get_full_hash(user, repo, short_hash)
|
|
59
67
|
result = $bitbucket.repos.commit.get_one(user, repo, short_hash)
|
|
60
68
|
return result["hash"]
|
|
@@ -137,7 +145,8 @@ def bitbucket(user, repo)
|
|
|
137
145
|
comment.inline? ? comment.inline.from : "",
|
|
138
146
|
comment.inline? ? comment.inline.path : "",
|
|
139
147
|
comment["links"].code? ? comment["links"].code.href : "",
|
|
140
|
-
comment.parent? ? comment.parent.id : ""
|
|
148
|
+
comment.parent? ? comment.parent.id : "",
|
|
149
|
+
comment["links"].code? ? extract_hash_from_diff(user, repo, comment["links"].code.href) : ""
|
|
141
150
|
]
|
|
142
151
|
end
|
|
143
152
|
break unless comments["next"]
|
|
@@ -289,7 +298,7 @@ def export_repos(argv)
|
|
|
289
298
|
rows = []
|
|
290
299
|
|
|
291
300
|
if $export == EXPORT_PR_COMMENTS
|
|
292
|
-
rows << %w[Repository Type PRNumber User CommentType CommentID BodyRaw BodyHTML CreatedAt IsDeleted ToLine FromLine FilePath Diff ParentID]
|
|
301
|
+
rows << %w[Repository Type PRNumber User CommentType CommentID BodyRaw BodyHTML CreatedAt IsDeleted ToLine FromLine FilePath Diff ParentID CommitHash]
|
|
293
302
|
else
|
|
294
303
|
rows << %w[Repository Type # User Title State CreatedAt UpdatedAt URL BodyRaw BodyHTML SourceCommit DestinationCommit SourceBranch DestinationBranch DeclineReason MergeCommit ClosedBy]
|
|
295
304
|
end
|