equal
deleted
inserted
replaced
1353 return |
1353 return |
1354 |
1354 |
1355 with repo.wlock(): |
1355 with repo.wlock(): |
1356 if opts.get(b'clean'): |
1356 if opts.get(b'clean'): |
1357 label = repo[b'.'].branch() |
1357 label = repo[b'.'].branch() |
1358 repo.dirstate.setbranch(label) |
1358 repo.dirstate.setbranch(label, repo.currenttransaction()) |
1359 ui.status(_(b'reset working directory to branch %s\n') % label) |
1359 ui.status(_(b'reset working directory to branch %s\n') % label) |
1360 elif label: |
1360 elif label: |
1361 |
1361 |
1362 scmutil.checknewlabel(repo, label, b'branch') |
1362 scmutil.checknewlabel(repo, label, b'branch') |
1363 if revs: |
1363 if revs: |
1369 _(b'a branch of the same name already exists'), |
1369 _(b'a branch of the same name already exists'), |
1370 # i18n: "it" refers to an existing branch |
1370 # i18n: "it" refers to an existing branch |
1371 hint=_(b"use 'hg update' to switch to it"), |
1371 hint=_(b"use 'hg update' to switch to it"), |
1372 ) |
1372 ) |
1373 |
1373 |
1374 repo.dirstate.setbranch(label) |
1374 repo.dirstate.setbranch(label, repo.currenttransaction()) |
1375 ui.status(_(b'marked working directory as branch %s\n') % label) |
1375 ui.status(_(b'marked working directory as branch %s\n') % label) |
1376 |
1376 |
1377 # find any open named branches aside from default |
1377 # find any open named branches aside from default |
1378 for n, h, t, c in repo.branchmap().iterbranches(): |
1378 for n, h, t, c in repo.branchmap().iterbranches(): |
1379 if n != b"default" and not c: |
1379 if n != b"default" and not c: |