Merges current changes with new one.
489668
public void merge(ChangesItem changesItem)
   {
      workspaceChangedSize += changesItem.getWorkspaceChangedSize();

      for (Entry<String, Long> changesEntry : changesItem.calculatedChangedNodesSize.entrySet())
      {
         String nodePath = changesEntry.getKey();
         Long currentDelta = changesEntry.getValue();

         Long oldDelta = calculatedChangedNodesSize.get(nodePath);
         Long newDelta = currentDelta + (oldDelta == null ? 0 : oldDelta);

         calculatedChangedNodesSize.put(nodePath, newDelta);
      }

      for (String path : changesItem.unknownChangedNodesSize)
      {
         unknownChangedNodesSize.add(path);
      }

      for (String path : changesItem.asyncUpdate)
      {
         asyncUpdate.add(path);
      }
   }
1369375
def merge_configs(default, overwrite):
    
    new_config = copy.deepcopy(default)

    for k, v in overwrite.items():
        # Make sure to preserve existing items in
        # nested dicts, for example `abbreviations`
        if isinstance(v, dict):
            new_config[k] = merge_configs(default[k], v)
        else:
            new_config[k] = v

    return new_config
82476
def update_with_diff(self, identifier, new_instance):
        
        with self.flushing():
            instance = self.retrieve(identifier)
            before = Version(instance)
            self.merge(instance, new_instance)
            instance.updated_at = instance.new_timestamp()
            after = Version(instance)
        return instance, before - after
776716
function (change) {
			if (this.compoundChange) {
				this.compoundChange.add(change);
			} else {
				var length = this.stack.length;
				this.stack.splice(this.index, length-this.index, change);
				this.index++;
				if (this.stack.length > this.size) {
					this.stack.shift();
					this.index--;
				}
			}
		}
997571
def _merge_results(self):
		
		new_dict = {}
		for it in self.data:
			new_dict.update(it)

		for k,v in new_dict.items():
			for kk, vv in v.time_stamps.items():
				for kkk,vvv in vv.items():
					new_dict[k].time_stamps[kk][kkk] = vvv - self.HB_config['time_ref']

		self.data = new_dict
194331
def merge(other)
      result = Env.new
      result.env = @env.merge(other.env)
      return result
    end
288961
def merge_from(self, other):
        """"""
        if other.national_number_pattern is not None:
            self.national_number_pattern = other.national_number_pattern
        if other.example_number is not None:
            self.example_number = other.example_number
1277897
void merge(Settings other) {
    for (int i = 0; i < COUNT; i++) {
      if (!other.isSet(i)) continue;
      set(i, other.flags(i), other.get(i));
    }
  }
127293
def merge_parts(self, version_id=None, **kwargs):
        """"""
        self.file.update_checksum(**kwargs)
        with db.session.begin_nested():
            obj = ObjectVersion.create(
                self.bucket,
                self.key,
                _file_id=self.file_id,
                version_id=version_id
            )
            self.delete()
        return obj
994538
protected function mergeConfigs()
    {
        $repo   = $this->getConfigRepository();
        $config = $repo->get(static::CONFIG_FILE_NAME_WO_EXT, []);
        $base   = $this->getBaseConfig();
        $result = $config + $base;
        $repo->set(static::CONFIG_FILE_NAME_WO_EXT, $result);
    }
214488
def changes
      changes = {'new' => {}, 'obsolete' => {}, 'updated' => {}}

      if @environment.nil?
        new_environments.each do |env|
          changes['new'][env] = {}
        end

        old_environments.each do |env|
          changes['obsolete'][env] = {}
        end
      else
        env = @environment
        changes['new'][env] = {} if new_environments.include?(@environment)
        changes['obsolete'][env] = {} if old_environments.include?(@environment)
      end
      changes
    end
553741
def merge!(errors)
      if errors
        errors.each_pair do |field, messages|
          messages.each do |message|
            add(field, message)
          end
        end
      end
    end
627958
public void merge(Mutation<E,K> m) {
        Preconditions.checkNotNull(m);

        if (null != m.additions) {
            if (null == additions) additions = m.additions;
            else additions.addAll(m.additions);
        }

        if (null != m.deletions) {
            if (null == deletions) deletions = m.deletions;
            else deletions.addAll(m.deletions);
        }
    }
748997
def merge(other)
      old_attributes = attributes
      other_attributes = other.is_a?(Hash) ? other : other.attributes

      old_attributes.merge!(other_attributes) do |key, old_value, new_value|
        case key
        when :clusters, :contexts, :users
          old_value + new_value.reject do |new_mapping|
            old_value.any? { |old_mapping| old_mapping[:name] == new_mapping[:name] }
          end
        else
          case old_value
          when Array
            (old_value + new_value).uniq
          when Hash
            old_value.merge(new_value) do |_key, inner_old_value, inner_new_value|
              inner_old_value.nil? ? inner_new_value : inner_old_value
            end
          when NilClass
            new_value
          else
            warn "key is #{key} old val is #{old_value.inspect} and new val is #{new_value.inspect}"
            old_value
          end
        end
      end

      self.class.new(old_attributes)
    end
398502
def merge_values(src, new):
    """"""
    if isinstance(src, dict) and isinstance(new, dict):
        return merge_dicts(src, new)
    else:
        if not isinstance(src, list):
            src = [src]
        if not isinstance(new, list):
            new = [new]

        return merge_lists(src, new)
842450
def populate(self, other):
        """"""
        self.clear()
        self.update(other)
        self.reset_all_changes()
1061185
def merge(a, b):
    
    if isinstance(a, CONFIG_VALID) \
            and isinstance(b, CONFIG_VALID):
        # dict update
        if isinstance(a, dict) and isinstance(b, dict):
            a.update(b)
            return a
        # list update
        _a = list(a)
        for x in list(b):
            if x not in _a:
                _a.append(x)
        return _a
    if a and b:
        raise Exception("Cannot merge")
    raise NotImplementedError