##// END OF EJS Templates
simplemerge: stop merging file flags...
Martin von Zweigbergk -
r49338:58a3be48 default
parent child Browse files
Show More
@@ -19,12 +19,10 b''
19 from __future__ import absolute_import
19 from __future__ import absolute_import
20
20
21 from .i18n import _
21 from .i18n import _
22 from .node import nullrev
23 from . import (
22 from . import (
24 error,
23 error,
25 mdiff,
24 mdiff,
26 pycompat,
25 pycompat,
27 util,
28 )
26 )
29 from .utils import stringutil
27 from .utils import stringutil
30
28
@@ -424,12 +422,6 b' def _picklabels(defaults, overrides):'
424 return result
422 return result
425
423
426
424
427 def is_not_null(ctx):
428 if not util.safehasattr(ctx, "node"):
429 return False
430 return ctx.rev() != nullrev
431
432
433 def _mergediff(m3, name_a, name_b, name_base):
425 def _mergediff(m3, name_a, name_b, name_base):
434 lines = []
426 lines = []
435 conflicts = False
427 conflicts = False
@@ -546,21 +538,13 b' def simplemerge(ui, localctx, basectx, o'
546 )
538 )
547 conflicts = m3.conflicts and not mode == b'union'
539 conflicts = m3.conflicts and not mode == b'union'
548
540
549 # merge flags if necessary
550 flags = localctx.flags()
551 localflags = set(pycompat.iterbytestr(flags))
552 otherflags = set(pycompat.iterbytestr(otherctx.flags()))
553 if is_not_null(basectx) and localflags != otherflags:
554 baseflags = set(pycompat.iterbytestr(basectx.flags()))
555 commonflags = localflags & otherflags
556 addedflags = (localflags ^ otherflags) - baseflags
557 flags = b''.join(sorted(commonflags | addedflags))
558
559 mergedtext = b''.join(lines)
541 mergedtext = b''.join(lines)
560 if opts.get('print'):
542 if opts.get('print'):
561 ui.fout.write(mergedtext)
543 ui.fout.write(mergedtext)
562 else:
544 else:
563 localctx.write(mergedtext, flags)
545 # localctx.flags() already has the merged flags (done in
546 # mergestate.resolve())
547 localctx.write(mergedtext, localctx.flags())
564
548
565 if conflicts:
549 if conflicts:
566 return 1
550 return 1
General Comments 0
You need to be logged in to leave comments. Login now