Changeset 53d9e75793ca…
Parent 0c921ab7f3c3…
by Andrew Pritchard <andrewp@fogcreek.com>
Changes to one file · Browse files at 53d9e75793ca Showing diff from parent 0c921ab7f3c3 Diff from another changeset...
@@ -387,51 +387,46 @@
lfiles = lfutil.listlfiles(repo)
+ if filelist is not None:
+ lfiles = [f for f in lfiles if f in filelist]
+
if lfiles:
cachelfiles(ui, repo, '.')
- at = 0
- updated = 0
for lfile in lfiles:
- if filelist is None or lfile in filelist:
- if not os.path.exists(repo.wjoin(lfutil.standin(lfile))):
- lfdirstate.remove(lfile)
- continue
- if os.path.exists(repo.wjoin(lfutil.standin(os.path.join(lfile\
- + '.orig')))):
- shutil.copyfile(repo.wjoin(lfile), repo.wjoin(lfile + \
- '.orig'))
- at += 1
- expectedhash = repo[None][lfutil.standin(lfile)].data().strip()
- mode = os.stat(repo.wjoin(lfutil.standin(lfile))).st_mode
- if not os.path.exists(repo.wjoin(lfile)) or expectedhash != \
- lfutil.hashfile(repo.wjoin(lfile)):
- path = lfutil.findfile(repo, expectedhash)
- if path is not None:
- util.makedirs(os.path.dirname(repo.wjoin(lfile)))
- shutil.copy(path, repo.wjoin(lfile))
- os.chmod(repo.wjoin(lfile), mode)
- updated += 1
- if lfutil.standin(lfile) not in repo['.']:
- lfdirstate.add(lfutil.unixpath(lfile))
- elif expectedhash == repo['.'][lfutil.standin(lfile)] \
- .data().strip():
- lfdirstate.normal(lfutil.unixpath(lfile))
- else:
- lfutil.dirstate_normaldirty(lfdirstate,
- lfutil.unixpath(lfile))
- elif os.path.exists(repo.wjoin(lfile)) and mode != \
- os.stat(repo.wjoin(lfile)).st_mode:
+ if not os.path.exists(repo.wjoin(lfutil.standin(lfile))):
+ lfdirstate.remove(lfile)
+ continue
+ if os.path.exists(repo.wjoin(lfutil.standin(lfile + '.orig'))):
+ shutil.copyfile(repo.wjoin(lfile), repo.wjoin(lfile + '.orig'))
+ expectedhash = repo[None][lfutil.standin(lfile)].data().strip()
+ mode = os.stat(repo.wjoin(lfutil.standin(lfile))).st_mode
+ if not os.path.exists(repo.wjoin(lfile)) or expectedhash != \
+ lfutil.hashfile(repo.wjoin(lfile)):
+ path = lfutil.findfile(repo, expectedhash)
+ if path is not None:
+ util.makedirs(os.path.dirname(repo.wjoin(lfile)))
+ shutil.copy(path, repo.wjoin(lfile))
os.chmod(repo.wjoin(lfile), mode)
- updated += 1
if lfutil.standin(lfile) not in repo['.']:
lfdirstate.add(lfutil.unixpath(lfile))
- elif expectedhash == \
- repo['.'][lfutil.standin(lfile)].data().strip():
+ elif expectedhash == repo['.'][lfutil.standin(lfile)] \
+ .data().strip():
lfdirstate.normal(lfutil.unixpath(lfile))
else:
lfutil.dirstate_normaldirty(lfdirstate,
lfutil.unixpath(lfile))
+ elif os.path.exists(repo.wjoin(lfile)) and mode != \
+ os.stat(repo.wjoin(lfile)).st_mode:
+ os.chmod(repo.wjoin(lfile), mode)
+ if lfutil.standin(lfile) not in repo['.']:
+ lfdirstate.add(lfutil.unixpath(lfile))
+ elif expectedhash == \
+ repo['.'][lfutil.standin(lfile)].data().strip():
+ lfdirstate.normal(lfutil.unixpath(lfile))
+ else:
+ lfutil.dirstate_normaldirty(lfdirstate,
+ lfutil.unixpath(lfile))
removed = 0
for lfile in lfdirstate:
|
Loading...