Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
gitlab-ce
Commits
29e606de
Commit
29e606de
authored
Feb 02, 2015
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ExternalIssue base model to make issue referencing more robust for external issue trackers.
parent
2dfd2198
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
4 deletions
+30
-4
app/models/concerns/mentionable.rb
app/models/concerns/mentionable.rb
+4
-3
app/models/external_issue.rb
app/models/external_issue.rb
+25
-0
lib/gitlab/reference_extractor.rb
lib/gitlab/reference_extractor.rb
+1
-1
No files found.
app/models/concerns/mentionable.rb
View file @
29e606de
...
@@ -67,9 +67,10 @@ module Mentionable
...
@@ -67,9 +67,10 @@ module Mentionable
return
[]
if
text
.
blank?
return
[]
if
text
.
blank?
ext
=
Gitlab
::
ReferenceExtractor
.
new
ext
=
Gitlab
::
ReferenceExtractor
.
new
ext
.
analyze
(
text
,
p
)
ext
.
analyze
(
text
,
p
)
(
ext
.
issues_for
+
ext
.
merge_requests_for
+
(
ext
.
issues_for
(
p
)
+
ext
.
commits_for
).
uniq
-
[
local_reference
]
ext
.
merge_requests_for
(
p
)
+
ext
.
commits_for
(
p
)).
uniq
-
[
local_reference
]
end
end
# Create a cross-reference Note for each GFM reference to another Mentionable found in +mentionable_text+.
# Create a cross-reference Note for each GFM reference to another Mentionable found in +mentionable_text+.
...
...
app/models/external_issue.rb
0 → 100644
View file @
29e606de
class
ExternalIssue
def
initialize
(
issue_identifier
,
project
)
@issue_identifier
,
@project
=
issue_identifier
,
project
end
def
to_s
@issue_identifier
.
to_s
end
def
id
@issue_identifier
.
to_s
end
def
iid
@issue_identifier
.
to_s
end
def
==
(
other
)
other
.
is_a?
(
self
.
class
)
&&
(
to_s
==
other
.
to_s
)
end
def
project
@project
end
end
lib/gitlab/reference_extractor.rb
View file @
29e606de
...
@@ -71,7 +71,7 @@ module Gitlab
...
@@ -71,7 +71,7 @@ module Gitlab
if
entry_project
.
nil?
if
entry_project
.
nil?
false
false
else
else
project
.
nil?
||
project
.
id
==
entry_project
.
id
project
.
nil?
||
entry_project
.
default_issues_tracker?
end
end
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment