Tries to pull changes from external location.
198016
def fetch(self, url):
        
        url = self._get_url(url)
        so, se = self.run_git_command('ls-remote -h %s' % url)
        refs = []
        for line in (x for x in so.splitlines()):
            sha, ref = line.split('\t')
            refs.append(ref)
        refs = ' '.join(('+%s:%s' % (r, r) for r in refs))
        cmd = '''fetch %s -- %s''' % (url, refs)
        self.run_git_command(cmd)
619516
def report_change(project, path, old_content):
    
    resource = path_to_resource(project, path)
    if resource is None:
        return
    for observer in list(project.observers):
        observer.resource_changed(resource)
    if project.pycore.automatic_soa:
        rope.base.pycore.perform_soa_on_changed_scopes(project, resource,
                                                       old_content)
1301433
def pull_all_repos():
    """"""
    repos = ClonedRepo.objects.all()
    for repo in repos:
        if repo.origin is not None:
            pull_repo.delay(repo_name=repo.name)
244393
function pull() {
  var tasks = [],
      cwd = process.cwd();

  findRepos(function(err, repos) {
    if (err) return console.log(err);
    repos.forEach(function(repo) {
      tasks.push(function(done) {
        repo.status(function(err, status) {
          var name = status.repo.path.replace(cwd + '/', '');
          if (!status.clean) {
            console.log('Skipped '.red + name.bold + ' (not clean)'.grey);
            done();
          }
          else {
            console.log('Pulling '.green + name.bold);
            process.chdir(status.repo.path);
            exec('git fetch', function(err, stdout, stderr) {
              if (err) return done(stderr);
              if (stdout && argv.v) console.log(indent(stdout));
              exec('git rebase', function(err, stdout, stderr) {
                if (err) return done(stderr);
                if (stdout && argv.v) console.log(indent(stdout));
                done(null);
              });
            });
          }
        });
      });
    });

    async.series(tasks, function(err, results) {
      if (err) {
        console.log('Error:'.red);
        console.log(err);
      }
      else {
        console.log('Done!');
      }
    });
  });
}
141987
def fetch_changes(repo_path, up_commit='master'):
    
    last_up_commit = None
    prevcwd = os.getcwd()
    try:
        gitexe = 'git'
        os.chdir(repo_path)
        old_sources_timestamp = sources_latest_timestamp('.')
        shell_command([gitexe, 'pull'])
        last_up_commit = subprocess.check_output(['git', 'rev-parse', 'HEAD'])
        shell_command([gitexe, 'checkout', up_commit])
        up_commit = subprocess.check_output(['git', 'rev-parse', 'HEAD'])
        new_sources_timestamp = sources_latest_timestamp('.')
        if old_sources_timestamp < new_sources_timestamp:
            with open('.timestamp', 'w') as up_commit_file:
                up_commit_file.write(up_commit)
    finally:
        os.chdir(prevcwd)
    return last_up_commit, up_commit
1285346
function move(src, dest) {
	return rename(src, dest).catch((err) => {
		// try copying
		return copy(src, dest).then(() => {
			// delete source
			return unlink(src);
		});
	});
}
764091
def action_update_library_location(_location):
    

    # if not(os.path.exists(_location)):
    # 	os.mkdir(_location)
    # 	printDebug("Creating new folder..", "comment")

    printDebug("Old location: '%s'" % get_home_location(), "comment")

    if os.path.isdir(_location):

        config = SafeConfigParser()
        config_filename = ONTOSPY_LOCAL + '/config.ini'
        config.read(config_filename)
        if not config.has_section('models'):
            config.add_section('models')

        config.set('models', 'dir', _location)
        with open(config_filename, 'w') as f:
            config.write(
                f)  # note: this does not remove previously saved settings

        return _location
    else:
        return None
647133
def _move_update(sourcepath, destname):
    """"""
    if sys.platform.startswith('linux'):
        return os.system("/bin/mv -fu '%s' '%s'" % (sourcepath, destname))
    else:
        return os.system("rsync -ua --remove-source-files '%s' '%s'" % (sourcepath, destname))
709718
def Pull(cls, connection, filename, dest_file, progress_callback):
        """"""
        if progress_callback:
            total_bytes = cls.Stat(connection, filename)[1]
            progress = cls._HandleProgress(lambda current: progress_callback(filename, current, total_bytes))
            next(progress)

        cnxn = FileSyncConnection(connection, b'<2I')
        try:
            cnxn.Send(b'RECV', filename)
            for cmd_id, _, data in cnxn.ReadUntil((b'DATA',), b'DONE'):
                if cmd_id == b'DONE':
                    break
                dest_file.write(data)
                if progress_callback:
                    progress.send(len(data))
        except usb_exceptions.CommonUsbError as e:
            raise PullFailedError('Unable to pull file %s due to: %s' % (filename, e))
361155
function handleCurrentFileChange() {
        var newFile = MainViewManager.getCurrentlyViewedFile(MainViewManager.ACTIVE_PANE);

        if (newFile) {
            var newDocument = DocumentManager.getOpenDocumentForPath(newFile.fullPath);

            if (newDocument) {
                _currentTitlePath = _shortTitleForDocument(newDocument);
            } else {
                _currentTitlePath = ProjectManager.makeProjectRelativeIfPossible(newFile.fullPath);
            }
        } else {
            _currentTitlePath = null;
        }

        // Update title text & "dirty dot" display
        _updateTitle();
    }
822889
def run_and_collect_multiple_changes(monitor, times, directory, *flags, &block)
      watch_and_run(monitor, times, false, directory, *flags, &block)
    end
1173921
def pull(self):
        """"""
        if not 'client' in session or session['client'].dead:
            client = Client(str(request.environ['pylons.routes_dict']['id']))
            print 'Adding new client:', client
            session['client'] = client
            session.save()
            yield request.environ['cogen.core'].events.AddCoro(client.watch, prio=priority.CORO)
            return
        else:
            client = session['client']

        yield request.environ['cogen.call'](client.messages.get)(timeout=10)

        if isinstance(request.environ['cogen.wsgi'].result, events.OperationTimeout):
            pass
        elif isinstance(request.environ['cogen.wsgi'].result, Exception):
            import traceback
            traceback.print_exception(*request.environ['cogen.wsgi'].exception)
        else:
            yield "%s\r\n"% '\r\n'.join(request.environ['cogen.wsgi'].result)
1089270
def _pull(self):
        '''
        
        '''

        pull = self.m(
            'pulling remote changes',
            cmdd=dict(cmd='git pull --tags', cwd=self.local),
            critical=False
        )
        if 'CONFLICT' in pull.get('out'):
            self.m(
                'Congratulations! You have merge conflicts in the repository!',
                state=True,
                more=pull
            )
        return pull
595517
def consume_changes(self, start, end):
        """"""
        left, right = self._get_changed(start, end)
        if left < right:
            del self.lines[left:right]
        return left < right
173340
def refresh(path=None):
    """"""
    global GIT_OK
    GIT_OK = False

    if not Git.refresh(path=path):
        return
    if not FetchInfo.refresh():
        return

    GIT_OK = True
23265
function forceCopy(fs, oldPath, newPath, callback) {
  fs.unlink(newPath, function(err) {
    if(err && err.code !== 'ENOENT') {
      return callback(err);
    }

    fs.readFile(oldPath, function(err, buf) {
      if(err) {
        return callback(err);
      }

      fs.writeFile(newPath, buf, callback);
    });
  });
}
766497
private void fireChangeFromNative() {

        // skip firing the change event, if the external flag is set
        if (m_initialized && !m_externalValueChange && m_active) {
            Scheduler.get().scheduleDeferred(new ScheduledCommand() {

                public void execute() {

                    try {
                        fireValueChange(false);
                    } catch (Throwable t) {
                        // this may happen when returning from full screen mode, nothing to be done
                    }
                }
            });
        }
        // reset the external flag
        m_externalValueChange = false;
    }