Adds a new file to a changelist

        :param filename: File path to add
        :type filename: str
        :param change: Changelist to add the file to
        :type change: int
        :returns: :class:`.Revision`
354659
def add(self, filename, change=None):
        
        try:
            if not self.canAdd(filename):
                raise errors.RevisionError('File is not under client path')

            if change is None:
                self.run(['add', filename])
            else:
                self.run(['add', '-c', str(change.change), filename])

            data = self.run(['fstat', filename])[0]
        except errors.CommandError as err:
            LOGGER.debug(err)
            raise errors.RevisionError('File is not under client path')

        rev = Revision(data, self)

        if isinstance(change, Changelist):
            change.append(rev)

        return rev
1022189
def _addDataFile(self, filename):
        
        if filename.endswith('.ttl'):
            self._rdfGraph.parse(filename, format='n3')
        else:
            self._rdfGraph.parse(filename, format='xml')
370141
def change_filename(filehandle, meta):
    
    filename = secure_filename(meta.get('filename', filehandle.filename))
    basename, _ = os.path.splitext(filename)
    meta['original_filename'] = filehandle.filename
    filehandle.filename = filename + '.jpg'
    return filehandle
260331
function addFile(filename) {
        if (ignoredPaths.contains(filename)) {
            return;
        }
        filename = fs.realpathSync(filename);
        if (added[filename]) {
            return;
        }
        files.push(filename);
        added[filename] = true;
    }
1274261
def add_file_argument(self, *args, **kwargs):
        
        rval = self.add_argument(*args, **kwargs)
        self.file_args.append(rval)
        return rval
389575
public synchronized void addFile(String filename, String filePath) {
        // fix this to check if duplicate name exists.
        int fileIndex = fileNameList.indexOf(filename);
        if (fileIndex == -1) {
            fileNameList.add(filename);
            filePathList.add(filePath);
        }
    }
1280449
def any_file_changed(filenames, hash_type='md5'):
    
    changed = False
    for filename in filenames:
        if callable(filename):
            filename = str(filename())
        else:
            filename = str(filename)
        old_hash = unitdata.kv().get('reactive.files_changed.%s' % filename)
        new_hash = host.file_hash(filename, hash_type=hash_type)
        if old_hash != new_hash:
            unitdata.kv().set('reactive.files_changed.%s' % filename, new_hash)
            changed = True  # mark as changed, but keep updating hashes
    return changed
810150
def canAdd(self, filename):
        
        try:
            result = self.run(['add', '-n', '-t', 'text', filename])[0]
        except errors.CommandError as err:
            LOGGER.debug(err)
            return False

        if result.get('code') not in ('error', 'info'):
            return True

        LOGGER.warn('Unable to add {}: {}'.format(filename, result['data']))

        return False
1036249
def add(self, files):
    
    if files.__class__.__name__ == 'str':
      self._files.append(files)
    else:
      self._files.extend(files)
298192
def savefig(self, filename, **kwargs):
        
        filename = os.path.expanduser(filename)
        kwargs.setdefault('show', False)
        kwargs.setdefault('save', filename)
        kwargs.setdefault('animate', False)
        return self._show_or_save(**kwargs)
1121681
def append_file(self, file, **options):
		
		self.append(PNG.open_any(file), **options)
872549
def edit(self, changelist=0):
        
        command = 'reopen' if self.action in ('add', 'edit') else 'edit'
        if int(changelist):
            self._connection.run([command, '-c', str(changelist.change), self.depotFile])
        else:
            self._connection.run([command, self.depotFile])

        self.query()
1062874
boolean add(Path filename) {
    synchronized (pendingReplications) {
      PendingInfo found = pendingReplications.get(filename);
      if (found == null) {
        pendingReplications.put(filename, new PendingInfo(filename));
        return true;
      }
      return false;
    }
  }
39656
def rewriteLoadCommands(self, changefunc):
        
        data = changefunc(self.parent.filename)
        changed = False
        if data is not None:
            if self.rewriteInstallNameCommand(
                    data.encode(sys.getfilesystemencoding())):
                changed = True
        for idx, name, filename in self.walkRelocatables():
            data = changefunc(filename)
            if data is not None:
                if self.rewriteDataForCommand(idx, data.encode(
                        sys.getfilesystemencoding())):
                    changed = True
        return changed
358784
def populate(self, filename):
        

        if os.path.isfile(filename):
            fid_st = os.stat(filename)
            self.name = os.path.abspath(filename)
            self.full_name = filename
            self.size = fid_st.st_size
            self.last_modified = fid_st.st_mtime
            self.last_accessed = fid_st.st_atime
            self.last_info_changed = fid_st.st_ctime
            self.location = os.path.dirname(filename)
643336
@Override
  public void addChange(DiffEntry change) {
    Path path = new Path(change.getNewPath());
    if (path.depth() == NODE_FILE_DEPTH) {
      addDataNode(change);
    } else if (path.depth() == EDGE_FILE_DEPTH) {
      addFlowEdge(change);
    }
  }
685865
def update(self, fname):
        
        ltfh = FileHandler(fname)
        self._log.addHandler(ltfh)