1858 Returns 0 on success, 1 if errors are encountered. |
1858 Returns 0 on success, 1 if errors are encountered. |
1859 """ |
1859 """ |
1860 with repo.wlock(False): |
1860 with repo.wlock(False): |
1861 return cmdutil.copy(ui, repo, pats, opts) |
1861 return cmdutil.copy(ui, repo, pats, opts) |
1862 |
1862 |
1863 @command('debugpushkey', [], _('REPO NAMESPACE [KEY OLD NEW]'), norepo=True) |
|
1864 def debugpushkey(ui, repopath, namespace, *keyinfo, **opts): |
|
1865 '''access the pushkey key/value protocol |
|
1866 |
|
1867 With two args, list the keys in the given namespace. |
|
1868 |
|
1869 With five args, set a key to new if it currently is set to old. |
|
1870 Reports success or failure. |
|
1871 ''' |
|
1872 |
|
1873 target = hg.peer(ui, {}, repopath) |
|
1874 if keyinfo: |
|
1875 key, old, new = keyinfo |
|
1876 r = target.pushkey(namespace, key, old, new) |
|
1877 ui.status(str(r) + '\n') |
|
1878 return not r |
|
1879 else: |
|
1880 for k, v in sorted(target.listkeys(namespace).iteritems()): |
|
1881 ui.write("%s\t%s\n" % (k.encode('string-escape'), |
|
1882 v.encode('string-escape'))) |
|
1883 |
|
1884 @command('debugpvec', [], _('A B')) |
1863 @command('debugpvec', [], _('A B')) |
1885 def debugpvec(ui, repo, a, b=None): |
1864 def debugpvec(ui, repo, a, b=None): |
1886 ca = scmutil.revsingle(repo, a) |
1865 ca = scmutil.revsingle(repo, a) |
1887 cb = scmutil.revsingle(repo, b) |
1866 cb = scmutil.revsingle(repo, b) |
1888 pa = pvec.ctxpvec(ca) |
1867 pa = pvec.ctxpvec(ca) |