~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/controllers/revision_ui.py

  • Committer: Matt Nordhoff
  • Date: 2009-05-18 05:08:58 UTC
  • mfrom: (346.2.2 serve-directory)
  • Revision ID: mnordhoff@mattnordhoff.com-20090518050858-3agh0ay1v2743m4t
Support "bzr serve"'s --directory argument.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
18
#
19
19
 
20
 
import simplejson
 
20
try:
 
21
    import simplejson
 
22
except ImportError:
 
23
    import json as simplejson
21
24
import urllib
22
25
 
23
26
from paste.httpexceptions import HTTPServerError
93
96
        h.add_branch_nicks(change)
94
97
 
95
98
        if '.' in change.revno:
96
 
            # Walk "up" though the merge-sorted graph until we find a
 
99
            # Walk "down" though the merge-sorted graph until we find a
97
100
            # revision with merge depth 0: this is the revision that merged
98
101
            # this one to mainline.
99
102
            ri = self._history._rev_info
100
103
            i = self._history._rev_indices[change.revid]
101
104
            while ri[i][0][2] > 0:
102
 
                i -= 1
 
105
                i += 1
103
106
            merged_in = ri[i][0][3]
104
107
        else:
105
108
            merged_in = None