1852 Returns 0 on success, 1 if errors are encountered. |
1852 Returns 0 on success, 1 if errors are encountered. |
1853 """ |
1853 """ |
1854 with repo.wlock(False): |
1854 with repo.wlock(False): |
1855 return cmdutil.copy(ui, repo, pats, opts) |
1855 return cmdutil.copy(ui, repo, pats, opts) |
1856 |
1856 |
1857 @command('debugsuccessorssets', |
|
1858 [], |
|
1859 _('[REV]')) |
|
1860 def debugsuccessorssets(ui, repo, *revs): |
|
1861 """show set of successors for revision |
|
1862 |
|
1863 A successors set of changeset A is a consistent group of revisions that |
|
1864 succeed A. It contains non-obsolete changesets only. |
|
1865 |
|
1866 In most cases a changeset A has a single successors set containing a single |
|
1867 successor (changeset A replaced by A'). |
|
1868 |
|
1869 A changeset that is made obsolete with no successors are called "pruned". |
|
1870 Such changesets have no successors sets at all. |
|
1871 |
|
1872 A changeset that has been "split" will have a successors set containing |
|
1873 more than one successor. |
|
1874 |
|
1875 A changeset that has been rewritten in multiple different ways is called |
|
1876 "divergent". Such changesets have multiple successor sets (each of which |
|
1877 may also be split, i.e. have multiple successors). |
|
1878 |
|
1879 Results are displayed as follows:: |
|
1880 |
|
1881 <rev1> |
|
1882 <successors-1A> |
|
1883 <rev2> |
|
1884 <successors-2A> |
|
1885 <successors-2B1> <successors-2B2> <successors-2B3> |
|
1886 |
|
1887 Here rev2 has two possible (i.e. divergent) successors sets. The first |
|
1888 holds one element, whereas the second holds three (i.e. the changeset has |
|
1889 been split). |
|
1890 """ |
|
1891 # passed to successorssets caching computation from one call to another |
|
1892 cache = {} |
|
1893 ctx2str = str |
|
1894 node2str = short |
|
1895 if ui.debug(): |
|
1896 def ctx2str(ctx): |
|
1897 return ctx.hex() |
|
1898 node2str = hex |
|
1899 for rev in scmutil.revrange(repo, revs): |
|
1900 ctx = repo[rev] |
|
1901 ui.write('%s\n'% ctx2str(ctx)) |
|
1902 for succsset in obsolete.successorssets(repo, ctx.node(), cache): |
|
1903 if succsset: |
|
1904 ui.write(' ') |
|
1905 ui.write(node2str(succsset[0])) |
|
1906 for node in succsset[1:]: |
|
1907 ui.write(' ') |
|
1908 ui.write(node2str(node)) |
|
1909 ui.write('\n') |
|
1910 |
|
1911 @command('debugtemplate', |
1857 @command('debugtemplate', |
1912 [('r', 'rev', [], _('apply template on changesets'), _('REV')), |
1858 [('r', 'rev', [], _('apply template on changesets'), _('REV')), |
1913 ('D', 'define', [], _('define template keyword'), _('KEY=VALUE'))], |
1859 ('D', 'define', [], _('define template keyword'), _('KEY=VALUE'))], |
1914 _('[-r REV]... [-D KEY=VALUE]... TEMPLATE'), |
1860 _('[-r REV]... [-D KEY=VALUE]... TEMPLATE'), |
1915 optionalrepo=True) |
1861 optionalrepo=True) |