scm: mercurial: latest changesets support named branch (#7246).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5127 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
59c791b2e1
commit
8944150ace
@ -94,8 +94,17 @@ class Repository::Mercurial < Repository
|
|||||||
|
|
||||||
def latest_changesets_cond(path, rev, limit)
|
def latest_changesets_cond(path, rev, limit)
|
||||||
cond, args = [], []
|
cond, args = [], []
|
||||||
|
if scm.branchmap.member? rev
|
||||||
if last = rev ? find_changeset_by_name(scm.tagmap[rev] || rev) : nil
|
# Mercurial named branch is *stable* in each revision.
|
||||||
|
# So, named branch can be stored in database.
|
||||||
|
# Mercurial provides *bookmark* which is equivalent with git branch.
|
||||||
|
# But, bookmark is not implemented.
|
||||||
|
cond << "#{Changeset.table_name}.scmid IN (?)"
|
||||||
|
# Revisions in root directory and sub directory are not equal.
|
||||||
|
# So, in order to get correct limit, we need to get all revisions.
|
||||||
|
# But, it is very heavy.
|
||||||
|
args << scm.nodes_in_branch(rev, :limit => limit)
|
||||||
|
elsif last = rev ? find_changeset_by_name(scm.tagmap[rev] || rev) : nil
|
||||||
cond << "#{Changeset.table_name}.id <= ?"
|
cond << "#{Changeset.table_name}.id <= ?"
|
||||||
args << last.id
|
args << last.id
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user