~cjwatson/brz-svn/fix-http-probe

« back to all changes in this revision

Viewing changes to changes.py

  • Committer: Jelmer Vernooij
  • Date: 2020-02-03 09:16:45 UTC
  • Revision ID: jelmer@jelmer.uk-20200203091645-q0f1yq77zkr1s3cz
More Python3 / formatting / breezy fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
15
 
16
16
 
17
 
"""Utility functions for dealing with changes dictionaries as return by Subversions' log functions."""
 
17
"""Utility functions for dealing with changes return by svn ' log functions."""
18
18
 
19
19
from __future__ import absolute_import
20
20
 
123
123
    paths = sorted(paths)
124
124
    root = paths[0]
125
125
    for p in paths[1:]:
126
 
        if p.startswith(u"%s/" % root): # new path is child of root
 
126
        if p.startswith(u"%s/" % root):  # new path is child of root
127
127
            continue
128
 
        elif root.startswith(u"%s/" % p): # new path is parent of root
 
128
        elif root.startswith(u"%s/" % p):  # new path is parent of root
129
129
            root = p
130
130
        else:
131
131
            if u"" in paths:
132
132
                return u""
133
 
            return None # Mismatch
 
133
            return None  # Mismatch
134
134
    return root
135
135
 
 
136
 
136
137
def apply_reverse_changes(branches, changes):
137
138
    """Apply the specified changes on a set of branch names in reverse.
138
139
    (E.g. as if we were applying the reverse of a delta)