comparison hgext/drophack.py @ 1121:1a39b1b8e092

drophack: use `first` and `last` on smartset This matches the new changes in mercurial core.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Wed, 08 Oct 2014 18:17:21 -0700
parents f7f4a1fac6c0
children 1f8428096078
comparison
equal deleted inserted replaced
1120:9bc4857f573b 1121:1a39b1b8e092
117 return 1 117 return 1
118 if repo.revs('. and %ld', revs): 118 if repo.revs('. and %ld', revs):
119 newrevs = repo.revs('max(::. - %ld)', revs) 119 newrevs = repo.revs('max(::. - %ld)', revs)
120 if newrevs: 120 if newrevs:
121 assert len(newrevs) == 1 121 assert len(newrevs) == 1
122 newrev = newrevs[0] 122 newrev = newrevs.first()
123 else: 123 else:
124 newrev = -1 124 newrev = -1
125 commands.update(ui, repo, newrev) 125 commands.update(ui, repo, newrev)
126 ui.status(_('working directory now at %s\n') % repo[newrev]) 126 ui.status(_('working directory now at %s\n') % repo[newrev])
127 # get all markers and successors up to root 127 # get all markers and successors up to root