Updates the stacks that track the history of values for +PWD+ and
 +OLDPWD+
 @param [Pathname] pwd     expanded +PWD+
 @param [Pathname] oldpwd  expanded +OLDPWD+
 @return [void]
496766
def update_wd_stacks!(pwd, oldpwd)
      @pwd_stack[0] ||= pwd
      @oldpwd_stack[0] ||= oldpwd unless oldpwd.to_s.empty?

      # We haven't changed working directories; short-circuit.
      return if pwd == @pwd_stack[-1]

      # If the current +pwd+ is identical to the top of the +@oldpwd_stack+ and
      # the current +oldpwd+ is identical to the second-to-top entry, then a
      # previous cd/pushd has been undone.
      if pwd == @oldpwd_stack[-1] && oldpwd == @oldpwd_stack[-2]
        @pwd_stack.pop
        @oldpwd_stack.pop
      else # New cd/pushd
        @pwd_stack << pwd
        @oldpwd_stack << oldpwd
      end
    end
1046015
def ensure_lockfile(keep_outdated=False, pypi_mirror=None):
    """"""
    if not keep_outdated:
        keep_outdated = project.settings.get("keep_outdated")
    # Write out the lockfile if it doesn't exist, but not if the Pipfile is being ignored
    if project.lockfile_exists:
        old_hash = project.get_lockfile_hash()
        new_hash = project.calculate_pipfile_hash()
        if new_hash != old_hash:
            click.echo(
                crayons.red(
                    fix_utf8("Pipfile.lock ({0}) out of date, updating to ({1})…".format(
                        old_hash[-6:], new_hash[-6:]
                    )),
                    bold=True,
                ),
                err=True,
            )
            do_lock(keep_outdated=keep_outdated, pypi_mirror=pypi_mirror)
    else:
        do_lock(keep_outdated=keep_outdated, pypi_mirror=pypi_mirror)
1010588
def _registry_update(s, oldid):
        '''
        
        '''
        with _lock:
            sock_queue = ApplicationLayer._to_app.pop(oldid)
            ApplicationLayer._to_app[s._sockid()] = sock_queue
827735
def WritePathHashHistory(self, client_path, hash_entries):
    
    client_path_history = ClientPathHistory()
    for timestamp, hash_entry in iteritems(hash_entries):
      client_path_history.AddHashEntry(timestamp, hash_entry)

    self.MultiWritePathHistory({client_path: client_path_history})
621523
def update(self, key_vals=None, overwrite=True):
        
        if not key_vals:
            return
        write_items = self._update(key_vals, overwrite)
        self._root._root_set(self._path, write_items)
        self._root._write(commit=True)
1191066
def _update_current(self):
        
        if not self.current or self.current not in self.prefixes:
            if 'default' in self.prefixes:
                selected_current = 'default'
            elif self.prefixes:
                selected_current = sorted(self.prefixes.keys()).pop()
            else:
                # should never get here
                raise MalformedWorkdir(
                    'No current link and no prefixes in workdir %s' % self.path
                )

            logging.info(
                'Missing current link, setting it to %s',
                selected_current,
            )
            self._set_current(selected_current)
1316546
def process_data(old_data, new_data)
      logger.debug { "Master stacks: #{old_data.keys.join(",")} YAML stacks: #{new_data.keys.join(",")}" }

      new_data.reverse_each do |stackname, data|
        spinner "Processing stack #{pastel.cyan(stackname)}"
        process_stack_data(stackname, data, old_data)
        hint_on_validation_notifications(reader.notifications, reader.loader.source)
        abort_on_validation_errors(reader.errors, reader.loader.source)
      end

      old_set = Kontena::Stacks::StackDataSet.new(old_data)
      new_set = Kontena::Stacks::StackDataSet.new(new_data)
      if skip_dependencies?
        [old_set, new_set].each(&:remove_dependencies)
      end
      spinner "Analyzing upgrade" do
        Kontena::Stacks::ChangeResolver.new(old_set, new_set)
      end
    end
820678
def modify_stack(target_status, failure_message, &block)
      if wait?
        status = modify_stack_synchronously(&block)
        raise StackUpdateError, failure_message unless target_status === status
        status
      else
        modify_stack_asynchronously(&block)
      end
    end
1100765
private void updateFromStack(Stack stack) {
    long startTime = System.currentTimeMillis();

    // Update LocalPeer
    Peer sLocalPeer = stack.getMetaData().getLocalPeer();

    localPeer.setUri(sLocalPeer.getUri().toString());
    for (InetAddress ipAddress : sLocalPeer.getIPAddresses()) {
      localPeer.addIpAddress(ipAddress.getHostAddress());
    }
    localPeer.setRealm(sLocalPeer.getRealmName());
    localPeer.setVendorId(sLocalPeer.getVendorId());
    localPeer.setProductName(sLocalPeer.getProductName());
    localPeer.setFirmwareRev(sLocalPeer.getFirmware());
    for (org.jdiameter.api.ApplicationId appId : sLocalPeer.getCommonApplications()) {
      if (appId.getAuthAppId() != org.jdiameter.api.ApplicationId.UNDEFINED_VALUE) {
        localPeer.addDefaultApplication(ApplicationIdJMX.createAuthApplicationId(appId.getVendorId(), appId.getAuthAppId()));
      }
      else {
        localPeer.addDefaultApplication(ApplicationIdJMX.createAcctApplicationId(appId.getVendorId(), appId.getAcctAppId()));
      }
    }
    HashMap<String, DiameterStatistic> lpStats = new HashMap<String, DiameterStatistic>();
    for (StatisticRecord stat : ((IPeer) sLocalPeer).getStatistic().getRecords()) {
      lpStats.put(stat.getName(), new DiameterStatistic(stat.getName(), stat.getDescription(), stat.toString()));
    }
    localPeer.setStatistics(lpStats);

    MutableConfiguration config = (MutableConfiguration) stack.getMetaData().getConfiguration();

    // Update Parameters
    this.parameters = new ParametersImpl(config);

    // Update Network ...
    // ... Peers (config)
    for (Configuration curPeer : config.getChildren(PeerTable.ordinal())) {
      String name = curPeer.getStringValue(PeerName.ordinal(), "");
      Boolean attemptConnect = curPeer.getBooleanValue(PeerAttemptConnection.ordinal(), false);
      Integer rating = curPeer.getIntValue(PeerRating.ordinal(), 0);
      String ip = curPeer.getStringValue(PeerIp.ordinal(), null);
      String portRange = curPeer.getStringValue(PeerLocalPortRange.ordinal(), "");
      Integer portRangeLow = null;
      Integer portRangeHigh = null;
      if (portRange != null && !portRange.equals("")) {
        String[] rng = portRange.trim().split("-");
        portRangeLow = Integer.parseInt(rng[0]);
        portRangeHigh = Integer.parseInt(rng[1]);
      }
      String securityRef = curPeer.getStringValue(SecurityRef.ordinal(), "");
      network.addPeer(new NetworkPeerImpl(name, attemptConnect, rating, ip, portRangeLow, portRangeHigh, securityRef));
    }

    // ... More Peers (mutable)
    try {
      MutablePeerTable peerTable;
      peerTable = stack.unwrap(MutablePeerTable.class);
      //Peer p = n.addPeer("aaa://127.0.0.1:13868", "mobicents.org", true);
      for (Peer peer : peerTable.getPeerTable()) {
        PeerImpl p = (PeerImpl) peer;
        NetworkPeerImpl nPeer = new NetworkPeerImpl(p.getUri().toString(), p.isAttemptConnection(), p.getRating(), null, null, null, null);
        HashMap<String, DiameterStatistic> npStats = new HashMap<String, DiameterStatistic>();
        for (StatisticRecord stat : p.getStatistic().getRecords()) {
          npStats.put(stat.getName(), new DiameterStatistic(stat.getName(), stat.getDescription(), stat.toString()));
        }
        nPeer.setStatistics(npStats);
        network.addPeer(nPeer);
      }
    }
    catch (InternalException e) {
      logger.error("Failed to update Diameter Configuration from Stack Mutable Peer Table", e);
    }

    // ... Realms (configuration)
    /*for(Configuration realmTable : config.getChildren(RealmTable.ordinal())) {
      for(Configuration curRealm : realmTable.getChildren(RealmEntry.ordinal())) {
        String name = curRealm.getStringValue(RealmName.ordinal(), "");
        String hosts = curRealm.getStringValue(RealmHosts.ordinal(), "localhost");
        ArrayList<String> peers = new ArrayList<String>();
        for(String peer : hosts.split(",")) {
          peers.add(peer.trim());
        }
        String localAction = curRealm.getStringValue(RealmLocalAction.ordinal(), "LOCAL");
        Boolean dynamic = curRealm.getBooleanValue(RealmEntryIsDynamic.ordinal(), false);
        Long expTime = curRealm.getLongValue(RealmEntryExpTime.ordinal(), 0);
        Configuration[] sAppIds = curRealm.getChildren(ApplicationId.ordinal());
        ArrayList<ApplicationIdJMX> appIds = new ArrayList<ApplicationIdJMX>();
        for(Configuration appId : sAppIds) {
          Long acctAppId = appId.getLongValue(AcctApplId.ordinal(), 0);
          Long authAppId = appId.getLongValue(AuthApplId.ordinal(), 0);
          Long vendorId = appId.getLongValue(VendorId.ordinal(), 0);
          if(authAppId != 0) {
            appIds.add(ApplicationIdJMX.createAuthApplicationId(vendorId, authAppId));
          }
          else if (acctAppId != 0){
            appIds.add(ApplicationIdJMX.createAcctApplicationId(vendorId, acctAppId));
          }
        }
        network.addRealm(new RealmImpl(appIds, name, peers, localAction, dynamic, expTime));
      }
    }
     */
    // ... Realms (mutable)
    try {
      MutablePeerTableImpl mpt = (MutablePeerTableImpl) stack.unwrap(PeerTable.class);
      for (org.jdiameter.api.Realm realm : mpt.getAllRealms()) {
        IRealm irealm = null;
        if (realm instanceof IRealm) {
          irealm = (IRealm) realm;
        }
        ArrayList<ApplicationIdJMX> x = new ArrayList<ApplicationIdJMX>();
        x.add(ApplicationIdJMX.fromApplicationId(realm.getApplicationId()));
        network.addRealm(new RealmImpl(x, realm.getName(), new ArrayList<String>(Arrays.asList(((IRealm) realm).getPeerNames())),
            realm.getLocalAction().toString(), irealm != null ? irealm.getAgentConfiguration() : null, realm.isDynamic(), realm.getExpirationTime()));
      }
    }
    catch (Exception e) {
      logger.error("Failed to update Diameter Configuration from Stack Mutable Peer Table", e);
    }

    long endTime = System.currentTimeMillis();

    logger.debug("Info gathered in {}ms", (endTime - startTime));
  }
965039
def update_history(self) -> None:
        
        self.log.debug(f"Saving history. History is: \n{self.history}")

        jsons = []
        for item in self.history:
            json_item = item.__dict__

            # Convert sub-entries into JSON as well.
            json_item["output_records"] = self._parse_output_records(item)

            jsons.append(json_item)

        if not path.isfile(self.history_filename):
            open(self.history_filename, "a+").close()

        with open(self.history_filename, "w") as f:
            json.dump(jsons, f, default=lambda x: x.__dict__.copy(), sort_keys=True, indent=4)
            f.write("\n")
689105
function reorganizeHistoryArray(sHash){
			var iIndex = jQuery.inArray(currentHash, hashHistory);

			if ( !(iIndex === -1 || iIndex === hashHistory.length - 1) ) {
				hashHistory.splice(iIndex + 1, hashHistory.length - 1 - iIndex);
			}
			hashHistory.push(sHash);
		}
1183876
def ask_run_new_file(new_file_path, source_path, tmp)
      return if tmp && IRT.rails_server
      original_ask_run_new_file(new_file_path, source_path, tmp)
    end
413009
def set_root_path!
       raise 'APP_ROOT is not set' unless defined?(::APP_ROOT)
       raise 'APP_ROOT is not a directory' unless File.directory?(::APP_ROOT)

       @root_path =
         # Pathname is incompatible with Windows, but Windows doesn't have
         # real symlinks so File.expand_path is safe.
         if RUBY_PLATFORM =~ /(:?mswin|mingw)/
           File.expand_path(::APP_ROOT)

         # Otherwise use Pathname#realpath which respects symlinks.
         else
           Pathname.new(::APP_ROOT).realpath.to_s
         end

       Object.const_set(:RELATIVE_APP_ROOT, ::APP_ROOT.dup) unless defined?(::RELATIVE_APP_ROOT)
       ::APP_ROOT.replace @root_path
     end
161018
def _update_history(self):
        """"""
        version = self.data['new_version']
        history = self.vcs.history_file()
        if not history:
            logger.warn("No history file found")
            return
        history_lines = open(history).read().split('\n')
        headings = utils.extract_headings_from_history(history_lines)
        if not len(headings):
            logger.warn("No detectable existing version headings in the "
                        "history file.")
            inject_location = 0
            underline_char = '-'
        else:
            first = headings[0]
            inject_location = first['line']
            underline_line = first['line'] + 1
            try:
                underline_char = history_lines[underline_line][0]
            except IndexError:
                logger.debug("No character on line below header.")
                underline_char = '-'
        header = '%s (unreleased)' % version
        inject = [header,
                  underline_char * len(header),
                  '',
                  self.data['nothing_changed_yet'],
                  '',
                  '']
        history_lines[inject_location:inject_location] = inject
        contents = '\n'.join(history_lines)
        open(history, 'w').write(contents)
        logger.info("Injected new section into the history: %r", header)
673149
def update_paths(self):
        
        new_paths = []
        with self.lock:
            for path in expand_source_paths(iter_module_paths()):
                if path not in self.paths:
                    self.paths.add(path)
                    new_paths.append(path)
        if new_paths:
            self.watch_paths(new_paths)
60251
def update_dir_state(self):
        

        if self.dir_start and not self.after_start:
            self.set_after_start()
        elif not self.dir_start and self.after_start:
            self.reset_dir_track()
453931
function( url, data ) {
            data = data || {};

            //if there's forward history, wipe it
            if ( this.getNext() ) {
                this.clearForward();
            }

            // if the hash is included in the data make sure the shape
            // is consistent for comparison
            if ( data.hash && data.hash.indexOf( "#" ) === -1) {
                data.hash = "#" + data.hash;
            }

            data.url = url;
            this.stack.push( data );
            this.activeIndex = this.stack.length - 1;
        }