Kiln » largefiles » largefiles-kiln-truncated changes meant to be shipped in Kiln Extensions to aid migration path to Mercurial-bundled largefiles
Clone URL:  

Handle another couple of renames in Mercurial 1.9. Should fix bug 2082673.

Changeset 44e0431a6494

Parent d63c85494c58

by David Golub

Changes to one file · Browse files at 44e0431a6494 Showing diff from parent d63c85494c58 Diff from another changeset...

 
7
8
9
 
 
 
 
 
10
11
12
 
35
36
37
38
 
 
 
 
 
 
39
40
41
42
43
44
45
46
 
 
 
 
 
 
 
 
 
 
47
48
49
 
97
98
99
100
 
 
 
 
 
 
101
102
103
 
7
8
9
10
11
12
13
14
15
16
17
 
40
41
42
 
43
44
45
46
47
48
49
50
 
 
 
 
 
 
51
52
53
54
55
56
57
58
59
60
61
62
63
 
111
112
113
 
114
115
116
117
118
119
120
121
122
@@ -7,6 +7,11 @@
 from mercurial import util, url as url_  from mercurial.i18n import _   +try: + from mercurial import httpconnection +except ImportError: + pass +  import bfutil, basestore    class httpstore(basestore.basestore): @@ -35,15 +40,24 @@
  return     self.ui.debug('httpstore.sendfile(%s, %s)\n' % (filename, hash)) - baseurl, authinfo = url_.getauthinfo(self.url) + try: + # Mercurial >= 1.9 + baseurl, authinfo = util.url(self.url).authinfo() + except AttributeError: + # Mercurial <= 1.8 + baseurl, authinfo = url_.getauthinfo(self.url)   fd = None   try: - if 'ui' in inspect.getargspec(url_.httpsendfile.__init__)[0]: - # Mercurial >= 1.8 - fd = url_.httpsendfile(self.ui, filename, 'rb') - else: - # Mercurial <= 1.7 - fd = url_.httpsendfile(filename, 'rb') + try: + # Mercurial >= 1.9 + fd = httpconnection.httpsendfile(self.ui, filename, 'rb') + except ImportError: + if 'ui' in inspect.getargspec(url_.httpsendfile.__init__)[0]: + # Mercurial == 1.8 + fd = url_.httpsendfile(self.ui, filename, 'rb') + else: + # Mercurial <= 1.7 + fd = url_.httpsendfile(filename, 'rb')   request = urllib2.Request(bfutil.urljoin(baseurl, hash), fd)   try:   url = self.opener.open(request) @@ -97,7 +111,12 @@
  return False     def _verifyfile(self, cctx, cset, contents, standin, verified): - baseurl, authinfo = url_.getauthinfo(self.url) + try: + # Mercurial >= 1.9 + baseurl, authinfo = util.url(self.url).authinfo() + except AttributeError: + # Mercurial <= 1.8 + baseurl, authinfo = url_.getauthinfo(self.url)   filename = bfutil.split_standin(standin)   if not filename:   return False