Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHGe218ed5ba484: commit: use context manager for locks
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/commands.py (7 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
Martin von Zweigbergk | Jun 14 2018, 6:05 PM |
Status | Author | Revision | |
---|---|---|---|
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz |
- commit all non-binary files:: | - commit all non-binary files:: | ||||
hg commit --exclude "set:binary()" | hg commit --exclude "set:binary()" | ||||
- amend the current commit and set the date to now:: | - amend the current commit and set the date to now:: | ||||
hg commit --amend --date now | hg commit --amend --date now | ||||
""" | """ | ||||
wlock = lock = None | with repo.wlock(), repo.lock(): | ||||
try: | |||||
wlock = repo.wlock() | |||||
lock = repo.lock() | |||||
return _docommit(ui, repo, *pats, **opts) | return _docommit(ui, repo, *pats, **opts) | ||||
finally: | |||||
release(lock, wlock) | |||||
def _docommit(ui, repo, *pats, **opts): | def _docommit(ui, repo, *pats, **opts): | ||||
if opts.get(r'interactive'): | if opts.get(r'interactive'): | ||||
opts.pop(r'interactive') | opts.pop(r'interactive') | ||||
ret = cmdutil.dorecord(ui, repo, commit, None, False, | ret = cmdutil.dorecord(ui, repo, commit, None, False, | ||||
cmdutil.recordfilter, *pats, | cmdutil.recordfilter, *pats, | ||||
**opts) | **opts) | ||||
# ret can be 0 (no changes to record) or the value returned by | # ret can be 0 (no changes to record) or the value returned by |