~maria-captains/bzr-gtk/serg

« back to all changes in this revision

Viewing changes to commit.py

  • Committer: Sergei Golubchik
  • Date: 2014-05-05 15:43:36 UTC
  • Revision ID: sergii@pisem.net-20140505154336-outmnwfaf92a4xd6
cherry-pick http://bazaar.launchpad.net/~bzr-gtk/bzr-gtk/gtk3/revision/762

Avoid call to Repository.get_ancestry.

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
    last_revision = parents[0]
68
68
 
69
69
    if last_revision is not None:
70
 
        try:
71
 
            ignore = set(branch.repository.get_ancestry(last_revision,
72
 
                                                        topo_sorted=False))
73
 
        except errors.NoSuchRevision:
74
 
            # the last revision is a ghost : assume everything is new
75
 
            # except for it
76
 
            ignore = set([None, last_revision])
 
70
        graph = branch.repository.get_graph()
 
71
        ignore = set([r for r,ps in graph.iter_ancestry([last_revision])])
77
72
    else:
78
 
        ignore = set([None])
 
73
        ignore = set([])
79
74
 
80
75
    pm = []
81
76
    for merge in pending:
138
133
        """Setup the member variables for state."""
139
134
        self._basis_tree = self._wt.basis_tree()
140
135
        self._delta = None
141
 
        self._pending = pending_revisions(self._wt)
 
136
        self._wt.lock_read()
 
137
        try:
 
138
            self._pending = pending_revisions(self._wt)
 
139
        finally:
 
140
            self._wt.unlock()
142
141
 
143
142
        self._is_checkout = (self._wt.branch.get_bound_location() is not None)
144
143