##// END OF EJS Templates
merge: unify logic of couple of if-else's in manifestmerge()...
Pulkit Goyal -
r45853:cb0cd87e default
parent child Browse files
Show More
@@ -760,20 +760,14 b' def manifestmerge('
760 760 fa = branch_copies1.copy.get(
761 761 f, None
762 762 ) or branch_copies2.copy.get(f, None)
763 args, msg = None, None
763 764 if fa is not None:
764 mresult.addfile(
765 f,
766 mergestatemod.ACTION_MERGE,
767 (f, f, fa, False, pa.node()),
768 b'both renamed from %s' % fa,
769 )
765 args = (f, f, fa, False, pa.node())
766 msg = b'both renamed from %s' % fa
770 767 else:
771 mresult.addfile(
772 f,
773 mergestatemod.ACTION_MERGE,
774 (f, f, None, False, pa.node()),
775 b'both created',
776 )
768 args = (f, f, None, False, pa.node())
769 msg = b'both created'
770 mresult.addfile(f, mergestatemod.ACTION_MERGE, args, msg)
777 771 else:
778 772 a = ma[f]
779 773 fla = ma.flags(f)
@@ -898,20 +892,14 b' def manifestmerge('
898 892 )
899 893 elif f in branch_copies2.copy:
900 894 f2 = branch_copies2.copy[f]
895 msg, args = None, None
901 896 if f2 in m2:
902 mresult.addfile(
903 f,
904 mergestatemod.ACTION_MERGE,
905 (f2, f, f2, False, pa.node()),
906 b'remote copied from %s' % f2,
907 )
897 args = (f2, f, f2, False, pa.node())
898 msg = b'remote copied from %s' % f2
908 899 else:
909 mresult.addfile(
910 f,
911 mergestatemod.ACTION_MERGE,
912 (f2, f, f2, True, pa.node()),
913 b'remote moved from %s' % f2,
914 )
900 args = (f2, f, f2, True, pa.node())
901 msg = b'remote moved from %s' % f2
902 mresult.addfile(f, mergestatemod.ACTION_MERGE, args, msg)
915 903 elif f not in ma:
916 904 # local unknown, remote created: the logic is described by the
917 905 # following table:
General Comments 0
You need to be logged in to leave comments. Login now