##// END OF EJS Templates
merge: move conversion of file-key dict to action-key dict in mergeresult...
Pulkit Goyal -
r45836:f4a2b329 default
parent child Browse files
Show More
@@ -578,6 +578,19 b' class mergeresult(object):'
578 578 def commitinfo(self):
579 579 return self._commitinfo
580 580
581 @property
582 def actionsdict(self):
583 """ returns a dictionary of actions to be perfomed with action as key
584 and a list of files and related arguments as values """
585 # Convert to dictionary-of-lists format
586 actions = emptyactions()
587 for f, (m, args, msg) in pycompat.iteritems(self._actions):
588 if m not in actions:
589 actions[m] = []
590 actions[m].append((f, args, msg))
591
592 return actions
593
581 594 def setactions(self, actions):
582 595 self._actions = actions
583 596
@@ -1821,8 +1834,6 b' def update('
1821 1834 mergeforce=mergeforce,
1822 1835 )
1823 1836
1824 actionbyfile = mresult.actions
1825
1826 1837 if updatecheck == UPDATECHECK_NO_CONFLICT:
1827 1838 if mresult.hasconflicts():
1828 1839 msg = _(b"conflicting changes")
@@ -1832,9 +1843,9 b' def update('
1832 1843 # Prompt and create actions. Most of this is in the resolve phase
1833 1844 # already, but we can't handle .hgsubstate in filemerge or
1834 1845 # subrepoutil.submerge yet so we have to keep prompting for it.
1835 if b'.hgsubstate' in actionbyfile:
1846 if b'.hgsubstate' in mresult.actions:
1836 1847 f = b'.hgsubstate'
1837 m, args, msg = actionbyfile[f]
1848 m, args, msg = mresult.actions[f]
1838 1849 prompts = filemerge.partextras(labels)
1839 1850 prompts[b'f'] = f
1840 1851 if m == mergestatemod.ACTION_CHANGED_DELETED:
@@ -1847,19 +1858,19 b' def update('
1847 1858 % prompts,
1848 1859 0,
1849 1860 ):
1850 actionbyfile[f] = (
1861 mresult.actions[f] = (
1851 1862 mergestatemod.ACTION_REMOVE,
1852 1863 None,
1853 1864 b'prompt delete',
1854 1865 )
1855 1866 elif f in p1:
1856 actionbyfile[f] = (
1867 mresult.actions[f] = (
1857 1868 mergestatemod.ACTION_ADD_MODIFIED,
1858 1869 None,
1859 1870 b'prompt keep',
1860 1871 )
1861 1872 else:
1862 actionbyfile[f] = (
1873 mresult.actions[f] = (
1863 1874 mergestatemod.ACTION_ADD,
1864 1875 None,
1865 1876 b'prompt keep',
@@ -1879,20 +1890,16 b' def update('
1879 1890 )
1880 1891 == 0
1881 1892 ):
1882 actionbyfile[f] = (
1893 mresult.actions[f] = (
1883 1894 mergestatemod.ACTION_GET,
1884 1895 (flags, False),
1885 1896 b'prompt recreating',
1886 1897 )
1887 1898 else:
1888 del actionbyfile[f]
1899 del mresult.actions[f]
1889 1900
1890 1901 # Convert to dictionary-of-lists format
1891 actions = emptyactions()
1892 for f, (m, args, msg) in pycompat.iteritems(actionbyfile):
1893 if m not in actions:
1894 actions[m] = []
1895 actions[m].append((f, args, msg))
1902 actions = mresult.actionsdict
1896 1903
1897 1904 if not util.fscasesensitive(repo.path):
1898 1905 # check collision between files only in p2 for clean update
General Comments 0
You need to be logged in to leave comments. Login now