Changeset 0b1d58ee5c34…
Parent 67d19149537f…
by Kevin Gessner <kevin@fogcreek.com>
Changes to 3 files · Browse files at 0b1d58ee5c34 Showing diff from parent 67d19149537f Diff from another changeset...
@@ -1155,13 +1155,14 @@ f = bfutil.splitstandin(f)
def getdatafn():
+ fd = None
try:
fd = open(path, 'rb')
return fd.read()
finally:
- fd.close()
+ if fd: fd.close()
- getdata = getdatafn
+ if path: getdata = getdatafn
write(f, 'x' in ff and 0755 or 0644, 'l' in ff, getdata)
if subrepos:
|
@@ -36,9 +36,17 @@
def prepush(repo, other, force, revs):
try:
- # Mercurial 1.6 and higher
from mercurial import discovery
- return discovery.prepush(repo, other, force, revs, False)
+ try:
+ # Mercurial 1.6 through 2.0
+ return discovery.prepush(repo, other, force, revs, False)
+ except AttributeError:
+ # Mercurial 2.1 and higher
+ fci = discovery.findcommonincoming(repo, other, force=force)
+ outgoing = discovery.findcommonoutgoing(repo, other, onlyheads=revs, commoninc=fci, force=force)
+ if not force:
+ discovery.checkheads(repo, other, outgoing, fci[2], False)
+ return [True]
except ImportError:
# Mercurial 1.5 and lower
return repo.prepush(other, False, revs)
|
Loading...