Mercurial > hg-stable
comparison mercurial/localrepo.py @ 14102:7f45b1911893
pushkey: add hooks for pushkey/listkeys
author | Brodie Rao <brodie@bitheap.org> |
---|---|
date | Sun, 01 May 2011 11:12:36 +0200 |
parents | 924c82157d46 |
children | 3c3c53d8343a 3a3584967a93 |
comparison
equal
deleted
inserted
replaced
14101:0c5228836fcd | 14102:7f45b1911893 |
---|---|
1916 if not streamreqs - self.supportedformats: | 1916 if not streamreqs - self.supportedformats: |
1917 return self.stream_in(remote, streamreqs) | 1917 return self.stream_in(remote, streamreqs) |
1918 return self.pull(remote, heads) | 1918 return self.pull(remote, heads) |
1919 | 1919 |
1920 def pushkey(self, namespace, key, old, new): | 1920 def pushkey(self, namespace, key, old, new): |
1921 return pushkey.push(self, namespace, key, old, new) | 1921 self.hook('prepushkey', throw=True, namespace=namespace, key=key, |
1922 old=old, new=new) | |
1923 ret = pushkey.push(self, namespace, key, old, new) | |
1924 self.hook('pushkey', namespace=namespace, key=key, old=old, new=new, | |
1925 ret=ret) | |
1926 return ret | |
1922 | 1927 |
1923 def listkeys(self, namespace): | 1928 def listkeys(self, namespace): |
1924 return pushkey.list(self, namespace) | 1929 self.hook('prelistkeys', throw=True, namespace=namespace) |
1930 values = pushkey.list(self, namespace) | |
1931 self.hook('listkeys', namespace=namespace, values=values) | |
1932 return values | |
1925 | 1933 |
1926 def debugwireargs(self, one, two, three=None, four=None, five=None): | 1934 def debugwireargs(self, one, two, three=None, four=None, five=None): |
1927 '''used to test argument passing over the wire''' | 1935 '''used to test argument passing over the wire''' |
1928 return "%s %s %s %s %s" % (one, two, three, four, five) | 1936 return "%s %s %s %s %s" % (one, two, three, four, five) |
1929 | 1937 |